5

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?

3
  • Have you tried just manually adding the path in your environment path? i.e type path in your quick search and add it manually. Then restart you cmd . Commented Dec 6, 2020 at 10:16
  • Yes, added the Environment Variable manually, still does not work =( Commented Dec 6, 2020 at 10:23
  • @S_rp: if you find the answer useful could you please mark the answer as accepted (the gray tick mark on the left of the answer)? Commented Dec 8, 2020 at 11:34

2 Answers 2

3

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
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.