Use python 2.x version of pip

To see the document pip install TensorFlow python2.7, because there are reasons python3 and pip3 of ( pip2and /usr/bin/pip2looks like based python2.x, playing a -Vglance true and false, the command python2 -m pipreally use the 2.x)

[root@ python2.7]# pip -V
pip 19.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
[root@ python2.7]# pip2 -V
pip 19.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
[root@ python2.7]# /usr/bin/pip2 -V
pip 19.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
[root@ python2.7]# python2 -m pip -V
pip 18.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)

For such links confusion, you can use: python2 -m pip install --upgrade pipAfter updating python2 pip on the repair, you can use pip2 directly. But this case for the corresponding pip module already exists, if there is an error is reported No module named pip, you need to install pip ( https://pypi.org/project/pip/ download the file, unzip, python2 setup.py installinstall it).

Guess you like

Origin www.cnblogs.com/warcraft/p/10938357.html