Preface
In the previous article on the CentOS Cloud Server installation Python3 records how to customize the installation of Python3, in the back of the test PIP3 found a problem:
pip --version
Terminal printing:
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
As above: Pip version or Python2.7 version
Solve
Since the system and Python are not particularly familiar, the first thought is to ask the next Niang. Degrees Niang gave a few suggestions are all download pip then install. I'm not rushing to do it, but I'm going to read the official documents
There is such a statement:
It probably means:
1. See if the PIP is available in the system:
[[email protected] python3]# pip --versionpip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
2. See if the PIP exists in the installation package
[[email protected] python3]# python -m ensurepip --default-pipLooking in links: /tmp/tmpzzl1ppcaRequirement already satisfied: setuptools in ./lib/python3.7/site-packages (39.0.1)Requirement already satisfied: pip in ./lib/python3.7/site-packages (10.0.1)
3. As seen in step 2, PIP3 already exists in the Python3.7 installation file, but there is no corresponding soft chain
[[email protected] bin]# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3[[email protected] bin]# pip3 --versionpip 10.0.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)
4. Think of your Mac's Pip or PIP3, so also modify the soft chain.
Last login: Sat Sep 29 23:13:21 on ttys002liuyonghudeMacBook-Pro:~ liuyonghu$ pip3 --versionpip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6)liuyonghudeMacBook-Pro:~ liuyonghu$ which python3/usr/local/bin/python3liuyonghudeMacBook-Pro:~ liuyonghu$ which pip3/usr/local/bin/pip3liuyonghudeMacBook-Pro:~ liuyonghu$ ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/pip3 /usr/local/bin/pipliuyonghudeMacBook-Pro:~ liuyonghu$ pip --versionpip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6)
5. In fact, the process of finding the PIP path in the middle is laborious, also recorded.
[[email protected] python3]# pip--versionpip 8.1.2 from/usr/lib/python2.7/site-packages (python 2.7) [email protected] python3]# python-m ensurepip--default-piplooking in Links:/tmp/tmpzzl1ppcarequirement already Satisfied:setuptools in./lib/python3.7/site-packages (39.0.1) requirement already satisfied:pip in./lib/python3.7/ Site-packages (10.0.1) [[email protected] python3]# CD/USER/BIN-BASH:CD:/user/bin: No file or directory [[email Protected] python3]# cd/usr/bin[[email protected] bin]# ls pip*pip pip2 pip2.7[[email protected] bin]# mv Pip Pip.bak[[email protected] bin]# CD./lib/python3.7/site-packages (10.0.1)-bash: unexpected symbol ' (' There is a syntax error near the [[email Protected] bin]# CD usr/lib/python3.7/site-packages (10.0.1)-bash: unexpected symbol ' (' near syntax error [[email protected] bin]# CD Usr/lib/python3.7/site-packages-bash:cd:usr/lib/python3.7/site-packages: No file or directory [[email protected] bin]# MV Pip.bak pip[[email protected] bin]# ls pip*pip pip2 pip2.7[[eMail protected] bin]# CD usr/lib/python3.7-bash:cd:usr/lib/python3.7: No that file or directory [[email protected] bin]# CD Usr/local/python3-bash:cd:usr/local/python3: No file or directory [[email protected] bin]# CD/USR/LIB/PYTHON3.7-BASH:CD: /usr/lib/python3.7: No file or directory [[email protected] bin]# cd/usr/local[[email protected] local]# CD python3[[ email protected] python3]# ls pip*ls: Unable to access pip*: No file or directory [[email protected] python3]# Lsbin include Lib share [[email protected] python3]# CD lib[[email protected] lib]# CD lib-bash:cd:lib: No file or directory [[email Protected] lib]# ls PIP*LS: Unable to access pip*: No that file or directory [[email protected] lib]# CD. [[email protected] python3]# CD bin[[email protected] bin]# ls pip*pip3 pip3.7[[email protected] bin]# Ln-s/usr/local/python3/bin/pip3/usr/bin/pip3[[email protected] bin]# pip3--versionpip 10.0.1 from/usr/local/ Python3/lib/python3.7/site-packages/pip (Python 3.7)
Summarize:
1.python3 is extracted, in the scheduled directory, after compiling the installation, generated Python, pip execution files.
2. The instructions in the system exist in the/usr/*/bin/folder of different systems, if necessary, you can set up a soft chain.
Family Links:
Pinterest
Blog Park
CentOS Custom Installation PIP3