Python install location and version

Have you ever wondered how to check the install path of python and it’s version? If you have then this post is for you. It is very easy to check the version and install location of python on linux as well as on windows. First I will show the method of checking this on linux and then on windows.

  • On linux just type these two commands in the terminal:
# for python install path
root@bt:/$ which python

# for python version;
root@bt:/usr/bin$ python -V
Python 2.7.5
  • On windows type this commands in the command prompt for python version:
python -V

And type these commands in the python shell for python install path

>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)

This comes in handy when you need to know the version and path of python real quick. I hope you liked today’s post. Stay tuned for the next one. Do share your views in the comments below.



If you liked what you read then I am sure you will enjoy a newsletter of the content I create. I send it out every other month. It contains new stuff that I make, links I find interesting on the web, and occasional discount coupons for my book. Join the 5000+ other people who receive my newsletter:

I send out the newsletter once every other month. No spam, I promise + you can unsubscribe at anytime

✍️ Comments

Be the first to leave a comment! 🎉

Say something

Send me an email when someone comments on this post.

Thank you!

Your comment has been submitted and will be published once it has been approved. 😊