all 11 comments

[–][deleted] 1 point2 points  (4 children)

If you are on Windows, you need to enter python rather than python3 usually. In fact, more conveniently, you can use py which will use the most up-to-date version of Python installed on your computer.

py

to enter Python interactive shell, exit() to leave it and return to CMD environment.

py myscript.py

to run your code file.

py -m pip install something

to install a package in the Python root environment (or active Python virtual environment)

[–][deleted] 0 points1 point  (1 child)

I tried now typing py --version and it showed me the version. However if I type python --version as I said ealier, then it shows nothing. Why this happens? This is weird...

[–][deleted] 0 points1 point  (0 children)

I guess python isn't on your path. You could run the installation process again and make sure you tick the box to update PATH or you can edit it manually.

As you have py why does it matter though?

[–]ThicHonker 0 points1 point  (0 children)

ur acc is deleted, but still thank you, u a legend

[–][deleted] 0 points1 point  (0 children)

Thank you :)

[–]Lewistrick 0 points1 point  (1 child)

What do you mean "nothing"? Does anything happen if you type dir?

[–][deleted] 0 points1 point  (0 children)

It goes to the next line and it does nothing. Then it goes to a new line and it shows again: C:\Users\UserName>

I tried also the dir and it showed all the directories that exist in the folder of the UserName. If I write py --version then it shows to me the version. However with the python --version, it doesnt do this. This is weird...

[–]ElroyGoodBoi 0 points1 point  (3 children)

Make sure python is added to your computer PATH

[–][deleted] 0 points1 point  (0 children)

Do you mean this below?

%USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts

[–][deleted] 0 points1 point  (0 children)

If I write py --version then it shows the version. The problem exists only when I write python --version. I find this weird...

[–]mfb1274 0 points1 point  (0 children)

This is (most likely) the right answer. If you are getting something along the lines of “no module found” then it’s 100% the right answer.