Hung-Chi's Blog on github

Easy way to install both Python2.x and Python3.x in Windows




python check version


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/

  1. Firstly, install python 2.x
    For example, install in C:\Python27
  2. Install python 3.x
    For example, install in C:\Python36-32

install python example

Rename Python3

Go to python3 folder C:\Python36-32 rename python to python3 rename 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

python check version
Done!!!

P.S. Use pip with python3

A sample to use pip install xlrd(excel read).

python3 -m pip install xlrd 


Comments


Advertisement