更新后显示已经升级到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)
成功。