python-pip - Switch the python version under win10. The library python3 installed by pip for python2.7 cannot be used. Please tell me how to switch the Python version freely.
为情所困2017-07-05 11:02:01
0
3
2075
There are two versions of Python installed in win10, but the libraries installed by pip cannot be shared, and the versions installed by pip cannot be switched. I want to know how to solve it! ! !
If the original Python version is Python2.7, then all the libraries we installed under Python2.7 are stored in the ...Python27Libsite-packages directory. The same is true for Python3.5site-packages directory, you can try to copy the libraries in the 2.7 directory to the site-packages directory of 3.5.
Be careful here, because Python2 and 3 are very different, and many third-party libraries are not publicly available, so after you copy them, some libraries may have problems and cannot be used. You must be mentally prepared for this. .
The answer given by the above respondent is wrong, you can read the article I wrote
If the original
Python
version isPython2.7
, then all the libraries we installed underPython2.7
are stored in the...Python27Libsite-packages
directory. The same is true forPython3.5
site-packages
directory, you can try to copy the libraries in the2.7
directory to thesite-packages
directory of3.5
.Be careful here, because
Python2
and3
are very different, and many third-party libraries are not publicly available, so after you copy them, some libraries may have problems and cannot be used. You must be mentally prepared for this. .Use virtualenv to create an independent environment