Skip to content

Find Python installation directory

If you want add Python to your PATH or you need to reference it in some other way, here’s how you can locate it.

Fortunately, Python’s sys module has the value of the executable (e.g. the python.exe) stored, so you can run this code to get it:

import sys


Be First to Comment

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.