This article was reproduced in: http://qoogle.cn/?id=39
Premise:
Install both Python2 and Python3 under Windows,
The Python2 and Python3 should be installed directly underneath the C drive, respectively, under the Python27 and Python36 folders. (Avoid the program files to appear in the space, later will be wrong!) )
In order to facilitate simultaneous use, you need to rename the Python.exe under Python3 to Python3.exe. (keep default under Python2)
(Certainly the path path of the win system environment variable needs to be added!) Path to the Python2 and Pip. Python3 in the installation when there are hooks to add in, if there is no groove selection, also need to add, Python3.exe and Pip3.exe. )
Add: The path path of the WIN environment variable method (Python)
My Computer----high-level---environment variables--system variables--Find the change to: PATH
Double-click Path to add the appropriate path (to avoid insert errors, add to the front-end).
Cases:
Add a path under PYTHON36:
Note that there is no trailing slash! No slashes! No slashes! (I seem to encounter a failure when the slash will fail!) Not sure. But there must be a semicolon at the end, a semicolon!
Add a path under Python27:
and configure the corresponding PIP and PIP3 corresponding to Python2 and Python3 (also renamed!). ) (path slightly, same as).
Test:
1. Enter Python in CMD to verify that the Python.exe is the correct version 2.7:
12345 |
C:\Users\Administrator>python
Python
2.7
.
13
(v2.
7.13
:a06454b1afa1, Dec
17
2016
,
20
:
42
:
59
) [MSC v.
1500
32
bit (
Intel)] on win32
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more information.
>>>
|
Return information is correct! is the Python2 version.
Exit! Remember to quit! Quit, quit, quit! The important thing to say all over!
2. Verification Python3.exe
12345 |
C:\Users\Administrator>python3
Python
3.6
.
1
(v3.
6.1
:
69c0db5
, Mar
21 2017
,
17
:
54
:
52
) [MSC v.
1900
32
bit (Intel)]
on win32
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more information.
>>>
|
Return information is correct! is the Python3 version.
Exit! Remember to quit! Quit, quit, quit! The important thing to say all over!
3, verify the Pip.exe, check its version number! Input Pip-v
12 |
C:\Users\Administrator>pip - V pip 9.0 . 1 from c:\python27\lib\site - packages (python 2.7 ) |
That's right! Pip is from the Python2 version!
4, Verification Pip3.exe:
12 |
C:\Users\Administrator>pip3 - V Patal error in launcher:Unable to create process using ‘"‘ |
Return information, say wrong!
The previous practice, namely, the python3.5.1 approach: Upgrade Reinstall!
12 |
C:\Users\Administrator>python3 - m pip insatll pip Requirement already up - to - date: pip in c:\python36\lib\site - packages |
Return the message and say it's done! The reason is that python3.6.1 's Pip is the current version, i.e. no new updates are installed.
What to do? --Solutions:
1. Delete the Pip folder under C:\Python36\Lib\site-packages!
2, re-download the latest pip-9.0.1 source files on the official website: https://pypi.python.org/pypi/pip#downloads,
Give me a download link:
https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/ Pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
3, reinstall under Python3: in cmd into the extracted pip-9.0.1 folder, after executing the command:
Like my decompression on the C drive,
123 |
C:\Users\Administrator>cd / C:\>cd pip - 9.0 . 1 C:\pip - 9.0 . 1 >python3 setup.py install |
Go to the installation folder, execute the command, automatic installation is complete!
4, remember, be sure to remember, delete the new Pip.exe again!!! (File under C:\Python36\Scripts, keep the original Pip3.exe Oh!) )
Test again, whether Pip3.exe success:
12 |
c:\>pip3 - v pip 9.0 1 from c:\python36\lib\site - packages\pip - 9.0 1 - py3. 6.egg 3.6 ) |
Return information, PIP3 is from the Python3 version!
python3.6.1 environment configuration appears requirement already UP-TO-DATE:PIP in C:\python36\lib\site-packages solution