I have installed the latest Python for Win10 from Releases for Windows.
Just typing py in the Command Prompt Window starts Python.
Microsoft Windows [Version 10.0.15048]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\sg7>py
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>`enter code here`
Testing:
>>> print("hello!")
hello!
>>>
Please be aware that in my case Python was installed in C:\Users\sg7\AppData\Local\Programs\Python\Python36> directory
C:\Users\sg7\AppData\Local\Programs\Python\Python36>dir
Volume in drive C is Windows7_OS
Volume Serial Number is 1226-12D1
Directory of C:\Users\sg7\AppData\Local\Programs\Python\Python36
08/05/2018 07:38 AM <DIR> .
08/05/2018 07:38 AM <DIR> ..
12/18/2017 09:12 AM <DIR> DLLs
12/18/2017 09:12 AM <DIR> Doc
12/18/2017 09:12 AM <DIR> include
12/18/2017 09:12 AM <DIR> Lib
12/18/2017 09:12 AM <DIR> libs
10/03/2017 07:17 PM 30,334 LICENSE.txt
10/03/2017 07:17 PM 362,094 NEWS.txt
10/03/2017 07:15 PM 100,504 python.exe
10/03/2017 07:12 PM 58,520 python3.dll
10/03/2017 07:12 PM 3,610,776 python36.dll
10/03/2017 07:15 PM 98,968 pythonw.exe
08/05/2018 07:38 AM 196,096 Removescons.exe
08/05/2018 07:38 AM 26,563 scons-wininst.log
08/05/2018 07:38 AM <DIR> Scripts
12/18/2017 09:12 AM <DIR> tcl
12/18/2017 09:12 AM <DIR> Tools
06/09/2016 11:53 PM 87,888 vcruntime140.dll
9 File(s) 4,571,743 bytes
10 Dir(s) 20,228,898,816 bytes free
When I am at C:\Users\sg7> directory level python can be invoked by typing
AppData\Local\Programs\Python\Python36\python
C:\Users\samg>AppData\Local\Programs\Python\Python36\python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Newer Python 3.7 will be installed at:
C:\Users\YourUserNameHere\AppData\Local\Programs\Python\Python37
If you wish you can add to your path environment variable:
%USERPROFILE%\AppData\Local\Programs\Python\Python36
It finally worked!!!
I needed to do things to get it to work
- Add C:\Python27\ to the end of the PATH system variable
- Add C:\Python27\ to the end of the PYTHONPATH system variable
I had to add these to both for it to work.
If I added any subdirectories, it did not work for some reason.
Thank you all for your responses.
Python --version command isn't working on windows
Im trying to install Python, yet it keeps saying "Python was not found;". I installed it as a path, manually installed it as a path, help.
Cant find python through command prompt
Python: command not found
How should I interpret "CMD Can't Find Python"?
The error notice "CMD Can't Find Python"—how can I fix it?
Videos
I Tried installing it multiple times, deleting it, watching tutorials, nothing is helping.
One can run the python installer again and click Modify button.

Select py launcher checkbox.

Then click install button and wait for the installation completes.
After all of these, py command will come back to the terminal.
Run in the command line:
doskey py = python
This creates an alias for the python command and then you can use py to start the python interpreter.
If you get an error regarding doskey not being recognized as an internal or external command, add C:\Windows\System32; to the PATH and run the command again. You can follow the more detailed instructions here to modify the PATH.
New to this stuff. Installed Python 3.9.0 today. Added the exe file and scripts directory to Path manually. Still can't seem to get it working.
The commands I tried all starts with: "Python3 -m".
The "Python3 -m pip install" command didn't work either. But when I opened cmd inside the "Scripts" folder then tried "pip install" without the "Python3 -m " part, it worked.
So do I need to make changes to the "Python3 -m" part? The directory of the exe file is "C:\Python39"
Also if I have to run the commands inside Python (instead of running it on cmd normally) what changes do I have to make to the commands (like how I removed "Python3 -m" part from pip install)
When I type 'python -m pip install [something]',I know that i can just say pip install but in general it says 'Python nije prona' or in english ' python is not recognized as an internal or external command, operable program or batch file. '
I've tried to fix it countless times by reinstalling, deinstalling every python file i have on my pc then reinstalling it, adding python to the path in environment variables and yet nothing worked. Does anyone have a solution for this?
This could be a duplicate answer, but the following steps has worked for me.
Note: This is in the case of Anaconda is installed instead of vanilla Python in Windows environment.
Under System variables:
- Create a variable
PYTHONHOME = C:\Users\username\Anaconda3
- Add the below 2 entries under PATH system variable:
%PYTHONHOME%
C:\Users\username\Anaconda3\Scripts
- Close the command prompt if opened earlier and try any python command (Note: no need to restart the OS):
example: python --version
output: Python 3.7.1
Hope this was useful. Cheers!
The python install directory on Windows should have the following files (ignore the pyscopg and pillow files):

Your PATH environment variable should be like the below if you have install Python2 at the default location:
PATH=%PATH%;C:\Python27\;C:\Python27\Scripts\
You should also have the following in PATHEXT:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
I noticed in your environment variables you have Python27\Scripts; which is not correct. Try fixing that, and you'll have to close any command prompts if you change any environment variables. If the settings are as the above and you still can't run Python, do a re-install.
As suggested in comments, you could create an alias as follows:
alias python='python3'
by adding it to the ~/.bashrc file at the end of this file, exiting and reloading it in the current terminal using the next command: . ~/.bashrc
Or using linking:
As you can see below, my python points to python2, python2 points to python2.7.
To achieve the same, use:
sudo ln -s /usr/bin/python2.7 /usr/bin/python2
sudo ln -s /usr/bin/python2 /usr/bin/python
If you want python pointing to 3rd version, you could use the same, but the last command should be:
sudo ln -s /usr/bin/python3 /usr/bin/python
Example
$ whereis python
python: /usr/bin/python3.7 /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python3.7m-config /usr/bin/python3.7-config /usr/bin/python /usr/bin/python3.7m /usr/lib/python3.7 /usr/lib/python2.7 /usr/lib/python3.8 /etc/python3.7 /etc/python2.7 /etc/python /usr/local/lib/python3.7 /usr/local/lib/python2.7 /usr/include/python3.7 /usr/include/python2.7 /usr/include/python3.7m /usr/share/python /usr/share/man/man1/python.1.gz
user@lenovo:~$ ls -ailh /usr/bin/python*
1446954 lrwxrwxrwx 1 root root 7 жов 10 14:32 /usr/bin/python -> python2
1446952 lrwxrwxrwx 1 root root 9 жов 10 14:32 /usr/bin/python2 -> python2.7
1465834 -rwxr-xr-x 1 root root 3,6M лис 7 12:07 /usr/bin/python2.7
1447155 lrwxrwxrwx 1 root root 33 лис 7 12:07 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
1447156 lrwxrwxrwx 1 root root 16 жов 10 14:32 /usr/bin/python2-config -> python2.7-config
1442842 lrwxrwxrwx 1 root root 9 лют 12 00:23 /usr/bin/python3 -> python3.7
1449245 -rwxr-xr-x 2 root root 4,9M лис 20 11:21 /usr/bin/python3.7
1447339 lrwxrwxrwx 1 root root 33 лис 20 11:21 /usr/bin/python3.7-config -> x86_64-linux-gnu-python3.7-config
1449245 -rwxr-xr-x 2 root root 4,9M лис 20 11:21 /usr/bin/python3.7m
1447340 lrwxrwxrwx 1 root root 34 лис 20 11:21 /usr/bin/python3.7m-config -> x86_64-linux-gnu-python3.7m-config
1447341 lrwxrwxrwx 1 root root 16 жов 2 15:31 /usr/bin/python3-config -> python3.7-config
1442843 -rwxr-xr-x 1 root root 384 січ 30 2019 /usr/bin/python3-futurize
1442847 lrwxrwxrwx 1 root root 10 лют 12 00:23 /usr/bin/python3m -> python3.7m
1447342 lrwxrwxrwx 1 root root 17 жов 2 15:31 /usr/bin/python3m-config -> python3.7m-config
1442844 -rwxr-xr-x 1 root root 388 січ 30 2019 /usr/bin/python3-pasteurize
1447157 lrwxrwxrwx 1 root root 14 жов 10 14:32 /usr/bin/python-config -> python2-config
1455649 lrwxrwxrwx 1 root root 58 лип 10 2019 /usr/bin/pythontex -> ../share/texlive/texmf-dist/scripts/pythontex/pythontex.py
1450999 -rwxr-xr-x 1 root root 306 лип 10 2019 /usr/bin/pythontex3
For managing python3 versions, you can use python alternatives to create symbolic links:
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
And choose which one to use as using the command:
$ sudo update-alternatives --config python3
For managing python2 and python3 using update-alternatives, you could see in michael's answer.
This solution only applies to Ubuntu 20.04 (but sometimes people look at "similar issues" for a solution).
In the case you like python to refer to python3, you can simply install python-is-python3:
sudo apt-get install python-is-python3
After this, invoking python will work just fine.
