June 20, 2016
Recently, I started working on a project that was written in Python 3. I had Python 2.7 on my Windows 8 laptop prior to joining the project team and all I needed to do was go to the Python website, download Python 3 installer and then install. Simple yes? well not quite.
The first thing I noticed after a systems reboot was that running python from the command line was throwing all sorts of errors and python scripts that used to work no longer did. So I did some searching on google, stackoverflow and a few others and here is the solution I came up with which worked for me.
1. I soon found that installing Python 2 first, enabled both to happily coexist. Start by installing your python 2.x version followed by python3.
2. Go to the python3 default install path (in my system, i set the path to C:\Python3 ) and change python.exe to python3.exe
3. Edit your environment variables to include C:\Python27\;C:\Python27\Scripts\;C:\Python3\;C:\Python3\Scripts\;
Now in command line you can use
python for 2.7 and
python3 for 3.x.