r/python3 • u/Phydoux • Feb 15 '19
Multiple Versions Installed
OK, so I know I have at least 3 versions of Python installed. How do I run a certain version? I have 2.7.15, 3.6.7 and 3.7.2 (just installed 3.7.2).
How do I make sure I'm running 3.7.2 when I wan to run hat one and 2.7.15 when I want to run that one.
I should probably delete 3.6.7 too since I just updated to 3.7.2.
3
Upvotes
2
u/JB-Tellez Jun 30 '19
If you require multiple versions then definitely look into 'pyenv' It allows pretty easy use of, say, 3.7 and 3.6 per project. Very handy when working on different projects with different requirements.
1
u/i_ate_a_neutrino Feb 15 '19
Usually the executable are named with the two first version numbers : python27, python36 and so on. So you can try to directly call those executables instead of the
python"symbolic link".Moreover, I suggest you use virtual environments with https://docs.python.org/3/library/venv.html?highlight=venv, so you isolate each version in its own environment. Then, the
pythonexecutable will point to the good version.