Reputation: 51
Good day!
Installed the Python 3.9.1, checked "Add to path", the cmd did not work though. Added Environment Variable Path, both folder
C:\Users\XXXXX\AppData\Local\Programs\Python\Python39
(file manager opens the path to python.exe just fine) and script lines:
C:\Users\XXXXX\AppData\Local\Programs\Python\Python39
Still the commands python -version
and pip --version
do not work from the command line.
Py --version
works just fine though.
Anyone might share and idea what might be the reason?
Upvotes: 5
Views: 12556
Reputation: 842
This happens more often than one would think.
When you installed python from python.org
and follow the installer, post install, you should check your environment variables, and verify that you have no other python installation (or if you do just name them appropriately).
Often you can find that there is an Environment Variable, that includes a python version on the global Environment Variable Path.
To verify that you are targeting the correct python version put these two directories (replace, user and python version), at the top of your PATH
(user's path), and check that there are no conflicts with the rest of the PATH
variables.
C:\Users\XXXXX\AppData\Local\Programs\Python\PythonXX
C:\Users\XXXXX\AppData\Local\Programs\Python\PythonXX\Scripts
Upvotes: 3
Reputation: 16700
If you had Python installed in the system before, the new path is added at the end of PATH
system variable and when system looks for python.exe
it finds first the old version that is available under a different folder.
If you used a command window opened before the new version got installed, it is also possible that system variables did not reload. Close it and use a new one to check.
Upvotes: 0