I want to find out my Python installation path on Windows. For example:
C:\Python25
How can I find where Python is installed?
I want to find out my Python installation path on Windows. For example:
C:\Python25
How can I find where Python is installed?
Go to C:\Users\USER\AppData\Local\Programs\Python\Python36 if it is not there then open console by windows+^R Then type cmd and hit enter type python if installed in your local file it will show you its version from there type the following import os import sys os.path.dirname(sys.executable)
If you use
anaconda navigator
on windows, you can go tooenviornments
and scroll over the enviornments, theroot
enviorment will indicate where it is installed. It can help if you want to use this enviorment when you need to connect this to other applications, where you want to integrate some python code.If you have the
py
command installed, which you likely do, then just use the--list-paths
argument to the command:py --list-paths
Example output:
The * indicates the currently active version for scripts executed using the
py
command.If you need to know the installed path under Windows without starting the python interpreter, have a look in the Windows registry.
Each installed Python version will have a registry key in either:
HKLM\SOFTWARE\Python\PythonCore\versionnumber\InstallPath
HKCU\SOFTWARE\Python\PythonCore\versionnumber\InstallPath
In 64-bit Windows, it will be under the
Wow6432Node
key:HKLM\SOFTWARE\Wow6432Node\Python\PythonCore\versionnumber\InstallPath
To know where Python is installed you can execute
where python
in your cmd.exe.I installed 2 and 3 and had the same problem finding 3. Fortunately, typing path at the windows path let me find where I had installed it. The path was an option when I installed Python which I just forgot. If you didn't select setting the path when you installed Python 3 that probably won't work - unless you manually updated the path when you installed it. In my case it was at c:\Program Files\Python37\python.exe