Im trying to switch between python versions 3.6.6
and 3.7.0
in windows. I tried py -3.6.6
and doesn't work. Looked for options in py -h
, found none. I saw a couple of answers for switching between python versions 2.x
and 3.x
by adding #!python3
at the start of the file.
I'm able to switch between these by moving path variables up and down but I want to know if there is a option to switch between versions in cmd
like there is brew switch python version
in IOS.
Thank you.
If You have python of the same version with different subversion e.g. 2.6, 3.7,.. 3.9.
Use the below command to open specific python version's terminal in command prompt:
py -2.6
py -3.7
.
for installing modules in command prompt:
py -2.6 -m pip install <modules>
py -3.7 -m pip install <modules>
Change the path in environment variable after downloading python 3.7.0 in windows where you can find in the properties of My Computer in Advanced System Settings
The easiest way is simply type py -2
if you want to use python2, and py -3
if you want to use python3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With