I also met the case to use both python2 and python3 on my Windows machine. Here’s how i resolved it:
- download python2x and python3x, installed them.
- add
C:\Python35;C:\Python35\Scripts;C:\Python27;C:\Python27\Scriptsto environment variablePATH. - Go to
C:\Python35to renamepython.exetopython3.exe, also toC:\Python27, renamepython.exetopython2.exe. - restart your command window.
- type
python2 scriptname.py, orpython3 scriptname.pyin command line to switch the version you like.