This document aims to give an easy way to install both Python 2 &3. Python is a useful script programing language, but I never use it before. This is the first time I used. Recently, my manager wants me to write a tool to convert in game xml string table to Excel file. We must use Python3 (Unicode support) to deal with multi-language, and sadly our game compiler is based on Python 2… So, it’s also my first problem to face with.
一一一一一一一一一一一一一一一一一一一一一一一一
© Hung-Chi's Blog
https://hungchicheng.github.io/2017/07/04/Easy-way-to-install-both-python2.x-and-python3.x-in-windows7/
一一一一一一一一一一一一一一一一一一一一一一一一
Install Python2 &3
Go to the Python download page and download Python
https://www.python.org/downloads/
- Firstly, install python 2.x
For example, install in C:\Python27 - Install python 3.x
For example, install in C:\Python36-32
Rename Python3
Go to python3 folder C:\Python36-32
rename python to python3
Add System Environment Variables
add system environment back for Python2. (Because Python3 is installed)
Path
C:\Python27\;C:\Python27\Scripts\;
Check Python3 is corrently set.
Path
C:\Python36-32;C:\Python36-32\Scripts;
Test
Just Open CMD and check both python is correctly install.
python --version
python3 --version
Done!!!
P.S. Use pip with python3
A sample to use pip install xlrd(excel read).
python3 -m pip install xlrd