pip更新后还是旧版本的解决方法

更新后显示已经升级到19.1.1,结果再看下版本还是9.0.1
输入如下命令:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

如下:

root@ylm-virtual-machine:/home/ylm# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1734k  100 1734k    0     0   321k      0  0:00:05  0:00:05 --:--:--  370k

root@ylm-virtual-machine:/home/ylm# python get-pip.py
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
/tmp/tmpd9Klln/pip.zip/pip/_vendor/urllib3/util/ssl_.py:380: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/tmp/tmpd9Klln/pip.zip/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Collecting pip
/tmp/tmpd9Klln/pip.zip/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 106kB/s 
Installing collected packages: pip
  Found existing installation: pip 19.3.1
    Uninstalling pip-19.3.1:
      Successfully uninstalled pip-19.3.1
Successfully installed pip-19.3.1
/tmp/tmpd9Klln/pip.zip/pip/_vendor/urllib3/util/ssl_.py:139: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

然后查看版本发现找不到了

root@ylm-virtual-machine:/home/ylm# pip -V
bash: /usr/bin/pip: No such file or directory

重新下载

apt-get install python-pip

root@ylm-virtual-machine:/home/ylm# apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.

发现还是找不到

root@ylm-virtual-machine:/home/ylm# pip -V
bash: /usr/bin/pip: No such file or directory

运行下面代码:

root@ylm-virtual-machine:/home/ylm# which pip
/usr/local/bin/pip
root@ylm-virtual-machine:/home/ylm# pip
bash: /usr/bin/pip: No such file or directory
root@ylm-virtual-machine:/home/ylm# type pip
pip is hashed (/usr/bin/pip)
root@ylm-virtual-machine:/home/ylm# hash -r

再看一下版本

root@ylm-virtual-machine:/home/ylm# pip -V
pip 19.3.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
root@ylm-virtual-machine:/home/ylm# pip3 -V
pip 19.3.1 from /usr/local/lib/python3.4/dist-packages/pip (python 3.4)

成功。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值