简体   繁体   中英

How to run python from the terminal if I installed it using Visual Studio?

I have installed python using Visual Studio, but I can't use python from the command prompt. I also want to run python from the command prompt, but it is only accessible from Visual Studio. I have tried adding the path of the directory in which Visual Studio has installed python to the user environment variables, but typing python in the command prompt opens up Windows Store. Please somebody help me with this. Is there any way around or do I have to install python separately too.

go to python.org and download the latest version of python (You can download it from the windows store too). Then open a new terminal and write python --version .

NOTE: Don`t forget the open a new terminal.

step1 : install the python from python.org (dont forget to check the PATH installation radio button)

step2: check the python from CMD with command :

python --version

step3: go the project directory and run :

python your_project_file_name.py

thanks for replying. I figured out the answer myself, and thought to answer it for anyone in the future who comes across the same issue.

I went into settings->Apps

Find the python installation and click on it, select modify.

Then click on "modify installation" when the python installation repair window opens, then again click on "modify", make sure to select "Add python to path", and also py launcher option also.

That fixed the problem for me.

Thanks, again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM