When installing Python 2 and Python 3 on a Windows computer. The environment variables determine which one to use.
So one of the python executables may be on the PATH. You can rename the python executable such as python27.exe or python33.exe.
Then you can execute them like python27
or python33
on the CLI.
However when Python launches it utilises certain environment variables to get its dependencies.
The environment variable on Windows is PYTHONHOME
.
Change PYTHONHOME
to which the directory which houses the python executable.
Show all environment variables.
SET
Set the environment variable.
SET PYTHONHOME=C:\python33
Show all environment variables.
Get-ChildItem Env:
Set the environment variable.
$env:TestVariable = "This is a test environment variable."
Use setx http://technet.microsoft.com/en-us/library/cc755104.aspx
This works for both CMD and Powershell
This require a restart on the terminal.
You will also need to change the paths to the python executable and the python Scripts folder.