Ah, actually I have used to python2, I heard that Python3 grammar has a lot of different places, then I wrote before the algorithm changed it is not a day dog? So I have not switched to Python3. But Google's TensorFlow, under Windows can only support Python3, no way, at this time I decided to my computer with fashion python2 and python3, see if it is feasible.
First, we go to the official website, find the corresponding installation package!
Python3 is the following: version is 3.6.3
Https://www.python.org/ftp/python/3.6.3/python-3.6.3.exe
Python2 is the following: version is 2.7.14
Https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi
Then install Python3 First:
Did not think Ah, now Python also has a quick installation, but as a programmer, nature is to customize it, can not install C drive do not install C. Remember to check the bottom option so that you do not have to manually configure the environment variables, but manual configuration is not difficult.
Then click Next, to the location, choose a place to install.
Then after the installation is complete, go to cmd console and enter Python to see if the installation was successful.
Then install Python2:
There is a fork in the red part, and the environment variable cannot be added automatically. Maybe it's because we just loaded python3, and here we don't care about him, continue the installation until the installation is complete.
Next, you configure the environment variables. Right-click this computer, properties, then tap advanced system Settings, and then click Environment variables, such as:
After this step, edit the path value, and then click Edit Text (mainly used to the previous Win7 edit the text mode, feel that when adding variables, directly edit the text will be more convenient)
And then go to the front of the text, this python3 is automatically added, similar to this we add a bit of python2.
But this time, Python conflicts, so we need to rename them to differentiate. Find the installation directory for Python2 and Python3, and change Python and pythonw to PYTHON2,PYTHONW2 and PYTHON3,PYTHONW3. And then go to cmd and lose the command, we'll find:
But this is not enough for me, I said, I was to install TensorFlow before the Python3. So, you need to adjust the pip!
Now if we use PIP will be error, because we have changed the Python name, then what to do, simple, respectively, Python2 and 3 to reinstall PIP.
Then we will find that the PIP version defaults to PYTHON2,PIP3 to become python3.
At this point, the coexistence of two Python cases has been resolved.
How to install Python2 and Python3 at the same time on WIN10