DEV Community

Jason Cruz
Jason Cruz

Posted on

Using Multiple Python Versions? How-To

Jumping from Python 3.9 to Python 3.10 to Python 3.6?

If your any programmer you will run into the issues of installing one package off PIPY "thinking - This package will work, because", because someone on YouTube in 2020 used it to make something but its now 2022 and those packages either could be out of date and not maintained, or no one uses those packages anymore, or perhaps a "different" package thats 1000x better than the one you WANT to work is better to install instead.

rage

If you feeling the same grief, your not alone. But if your also like me, trying to figure out how to go from Python 3.10 to Python 3.2 and everything inbetween at first can be hard. But today folks, it doesnt have to be that hard anymore!

funny

Ill make it easier for you because I couldnt find anything useful online, can you believe that?! The Nerve!

Only Applies To Windows 10 - Maybe Other Windows Too

Those this only applies Windows 10, check your other systems and let me know! Id love to know!

As far as I know, you can install all Python packages your Windows 10 PC. When working with Python inside VSCode I didnt realize you needed to work inside virtual enviroments. In this case, you literally can switch between enviroments too when you change your main Python Interpreter versions.

Hit your Windows Key and type CMD, now lets see what version Python you have. Now type python --version inside your terminal. It should pull up something like this:

cheers

Now inorder to change your main Python Interpreter (meaning, when you pull up VSCode or any other IDE, as soon as you pull it up and want to use it to code, the first Interrupter that will comes up will be the default setting you have in your enviromental variables) lets open the Enviromental Variables;

Click the Windows Key and type enviroment and the first thing that pops up should be defined as the pic below.

no idea

Once you click on Edit the system enviroment variables next you will get a screen like this:

maybe

You guessed it! System Properties! Click on Enviroment Variables, Highlight Path and click on Edit..... Next you will be inside the Enviromenal Variables:

example 2

Highlight whatever Python Version you want to use, for sake of argument, Im going from Python 3.9.12 to Python 3.6.0. And move both variables to the top above what is currently your default Python Interpreter with the Scripts being first on the list. (dont ask me why, idk it just works lmao)

example 3

After you should get something like this:

example 4

Now save all your work! Hit OK to everything!!

Now test to see if it saved correctly inside your Windows 10 CMD window you previously opened. You should have something like this:

python version 3.6


ISNT SHOWING? - PLEASE TAKE NOTE

If you do not have this showing up, you probably MOST likely do not have that Python Version Package installed on your computer. What you are seeing is the remnants of the Path that wasnt deleted when you uninstalled your Python Package. So in order for you to make it work duh you need to reinstall that version you wanted to switch too.


Why doesn't anybody tell you this!?

How simple it was. Changing it inside VSCode.

Now inside your VSCode hit CTRL & SHIFT and hit P

Select Python: Select Interpreter

select

Hit refresh icon at the top right

refresh

Select the Python Version you want you use:

new version

After you have selected the new Interpreter you selected, file and open a python file you are working on and look at the very bottom right to see your awesomeness at work!

example

You should see the python version you selected.


TaDa!! Congrats For Reading!! Like, Share, Subscribe & Don't forget to Unicorn! lol

Top comments (0)