5

I recently installed Python 3.7.9 for a class I am taking. I am able to run python code both through the windows command prompt and Visual Studio 2019. I was making sure everything was set up correctly. However, when i run the command python --version, it just enters a blank line. IS there something im supposed to do after installing python to set up my Command Prompt?

1 Answer 1

3

VS code pulls from the specified file path for each python version, so it will work regardless of if python has been added to your PATH.

Does it give you an error when you just type python into your CMD (not inside vs code)?

If it does then you need to add python to your PATH, details for this can be found here:How to add a folder to `Path` environment variable in Windows 10 (with screenshots)

and the folder paths you need are:

%USERPROFILE%\AppData\Local\Programs\Python\Python37\Scripts\
%USERPROFILE%\AppData\Local\Programs\Python\Python37\
Sign up to request clarification or add additional context in comments.

9 Comments

The command python just sends me to a Microsoft Store page to download Python 3.8. I can still use the command py normally though. I will try what you have suggested.
@PixelmonMaster ah, I see. Don't use the microsoft store version, it breaks permissions. Download it directly from python.org/download and then make sure on the first page of the installer to check off "ADD TO PATH"
Im not planning on using the store version. I have already installed it.
I added those folder paths to my environment variable(Picture here imgur.com/a/l3DTxqm). It still does not work. I also tried with the %USERPROFILE% still there, but that failed as well.
@PixelmonMaster alternatively you can use the higher layer python windows launcher that should be installed by default I think. You can run py --version or py <file>.py instead which should use the latest copy unless specified.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.