Many people try to go to Python 3 but they got to keep up with Python 2 because of lack of support and not all plugins and mods are yet updated to Python 3. So if you want to install both version and execute both version scripts correctly, here is the trick.
First download both Python 2.x and Python 3.x and install them as usual, there won’t be any problem with it. During the installation choose different folders as installation directory for both. I have installed them in same drive and it looks like this.
You can execute python script with python 3 by entering ” C:\python33\python.exe scriptname.py ” in command prompt window and you can execute python script with python 2 by entering ” C:\python27\python.exe scriptname.py ”
Or if you want to execute them in command prompt window without much path typing job then follow the steps below.
OKAY, Now what we gonna do is add variable paths to the windows, I have already posted a tutorial about how to add system variable path to windows before.
Open System information window by clicking “System” icon in control panel or Just right click on “Computer” in start menu and select Properties.
Now Environment variable window appears, find path variables in system variables, select it and click on edit.Now a window appears asking you to enter paths.Move to the end of line and type this ” ;C:\python33;C:\python27 “. Because, they are my installation directory for python versions. You should enter the right directory you installed python in. And click OK, close all other windows.
Now we have added the Python paths to the system, so it is easily accessible from command prompt window. Now, Open the directory containing Python 3 and rename python.exe to python3.exe
Now in Python 2 Directory rename Python.exe to python2.exe