It is even easier using conda.[1] Install whichever you use the most (likely python3) using either the full anaconda installer or the simpler miniconda installer. Then use conda to create an environment that uses the other python release. One has another benefit: one can create custom environments for analyses where "dependency hell" is a common problem...<p>[1] <a href="https://conda.io/docs/" rel="nofollow">https://conda.io/docs/</a>
You know what? I appreciate the authors drill-down into the "how" of this issue but I'd like to focus on the "why".<p>Why, has it taken so long to get off of python2.x- noted I understand that a few libraries <i>cough</i>twisted<i>cough</i> have been holding projects back that depend on them. But I haven't wrote a single block of code in half a decade that wasn't python 2.x and python 3.x compatible.<p>At what point will we exclusively be developing on 3.x? I'm quite tired of the apologists claiming that making/maintaining things in 2.x is totally fine. At the very least you could run a pass of `2to3` (which is generally quite mature today) before claiming that it's difficult/impossible/too time consuming.
A missing point here:<p>If you have an accent in your username on windows, you are welcome to a kingdom of pain due to pip inability to process paths with non-ascii chars.
I get around this by installing both version of WinPython. It's super easy since you install them into separate directories. You can double click into the command prompt shortcut that links to the folder and use pip to your liking for each version. Changing the interpreter in PyCharm is about two clicks too.
I think this is why Docker is so darn useful.<p>Once you embrace it, using Python 2.x or 3.x on Windows (or MacOS, or Linux) involves changing 1 line in 1 file and you're pretty much done. Each app you develop can also use whatever version you want with total isolation.<p>There's no Windows hoops to jump through or virtual environments to create.
My approach to using both py2 and py3 in windows:
Use 2 folders of WinPython (completely portable) for py2 and py3.
A shell script which changes all the necessary env vars from 2->3, 3->2.
Just double-click on the shell script when you want to switch and you're done.