How to List All Available Python Versions on Windows

What happened

Not too long ago, while following an online tutorial to set up Stable Diffusion, I came across the requirement for Python version 3.10.6. I promptly checked my computer and found that my version was not correct; I was using 3.9…

List all python versions on Windows

we will be using basic Python commands. First, let’s list all the parameters.

py -h  #python's help command

And we will get this

Most of the commands are related to startup, but towards the end, we have the following:

  • -0 / –list: List all available Python versions.
  • -0p / –list-paths: List all available Python versions along with their paths.

Interestingly, both of these commands have two variations; you can choose either one ( –0 is the same as –list).

let’s take a look at how it works.

(* indicates the currently default version)

You can see that the new one is installed using the official Python installer, while the old one is managed through Anaconda.

Switch the default version

To switch the default version, you need to configure it in the PATH (System Properties > Advanced Settings).

The version that appears higher in the PATH will be set as the default.


Conclusion

I’ve always found managing Python versions to be a bit of a hassle. Well, it’s not just Python; I’m an engineer who struggles with the concept of environment setup.

Typically, when I need different Python versions, I resort to using Anaconda to create separate environments!

Reference

🧡 Hopefully, this post has helped you to some extent.

🧡You can support me by clicking some ad, Thanks a lot

If you got any problem about the explanation, please feel free to let me know

Some Random notes

Leave a Reply

Your email address will not be published. Required fields are marked *