python - Using pip to install numpy shows satisfied. In the 2.6 sitepackage, how to install it separately for 2.7?
習慣沉默2017-06-12 09:22:46
0
4
1093
Like the title, centos, every time I want to use it, I use 2.7, but the result is that 2.7 is not available, and the installation shows that it has been installed. What should I do?
As you can see, the pip you are using now is based on python2.6, so you need to reinstall a pip with python27, and make a soft connection of pip to the system environment variable to replace the old pip
Thanks for the invitation. First tell me the reason for your situation. Because the default version of pip is associated with python2.6. You need to create a soft connection to pip of python2.7. Delete the pip of python2.6.
If you are not very clear about this, then use another specific method: First uninstall the py2.7 you installed, and then find the path of python2.6's pip through which pip, and then delete the file (or rename it The document). Then install python2.7. Next time your pip will be the pip of py2.7
This is simple. I have several solutions. Let me explain slowly. 1. Go to the site-packages directory of python2.6 and copy the numpy-related folders and egg files directly to the same directory of python2.7. It should also work. 2. Of course, copying every time is annoying. First delete the pip in /usr/bin or /usr/local/bin, and then copy the pip file to /usr/bin or /usr under the script in the 2.7 directory. /local/bin. 3. First delete pip under /usr/bin or /usr/local/bin, and then use soft link ln -s /xxx/xx/pip /usr/bin/pip #Create a symbolic link file pip of 2.6 pip 4. Delete python, python2, and python2.7 under /usr/bin/ or /usr/local/bin, then find the 2.6 python, python2, and python2.6 programs, and copy them all to /usr/bin or / Under usr/local/bin 5. Enter python2.6 on the command line, provided that python2.6 is in the directory of your environment variables. 6. Enter pip2.6 install numpy on the command line, provided that it is in the directory of your environment variables. There is pip2.6 It’s up to you to choose, 5 and 6 are the easiest, don’t forget to like it if it’s easy to use
The final solution is
Download the source code package of setuptools and pip
Install setuptools and pip
pip install numpy
As you can see, the pip you are using now is based on python2.6, so you need to reinstall a pip with python27, and make a soft connection of pip to the system environment variable to replace the old pip
Thanks for the invitation. First tell me the reason for your situation. Because the default version of pip is associated with python2.6. You need to create a soft connection to pip of python2.7. Delete the pip of python2.6.
If you are not very clear about this, then use another specific method:
First uninstall the py2.7 you installed, and then find the path of python2.6's pip through
which pip
, and then delete the file (or rename it The document). Then install python2.7. Next time your pip will be the pip of py2.7This is simple. I have several solutions. Let me explain slowly.
1. Go to the site-packages directory of python2.6 and copy the numpy-related folders and egg files directly to the same directory of python2.7. It should also work.
2. Of course, copying every time is annoying. First delete the pip in /usr/bin or /usr/local/bin, and then copy the pip file to /usr/bin or /usr under the script in the 2.7 directory. /local/bin.
3. First delete pip under /usr/bin or /usr/local/bin, and then use soft link ln -s /xxx/xx/pip /usr/bin/pip #Create a symbolic link file pip of 2.6 pip
4. Delete python, python2, and python2.7 under /usr/bin/ or /usr/local/bin, then find the 2.6 python, python2, and python2.6 programs, and copy them all to /usr/bin or / Under usr/local/bin
5. Enter python2.6 on the command line, provided that python2.6 is in the directory of your environment variables. 6. Enter pip2.6 install numpy on the command line, provided that it is in the directory of your environment variables. There is pip2.6
It’s up to you to choose, 5 and 6 are the easiest, don’t forget to like it if it’s easy to use