简体   繁体   中英

Visual Studio Error Ctrl + Alt + N with Python

I'm new to coding and just started using Visual Studio to learn Python. In a tutorial video, the professor said that I can hit Ctrl + Alt + N to automatically run my code. I get the error "[Running] python -u "c:\\Users***\\Desktop\\Test\\app.py" 'python' is not recognized as an internal or external command, operable program or batch file." I am able to run it when I go to my terminal and run through CMD but not when I do the shortcut. I looked through settings and there wasn't anything I saw that stood out. Any suggestions?

Thanks

  1. Open the Start Search, type in “env”, and choose “Edit the system environment variables”:

  2. Click the “Environment Variables…” button

  3. Click on Path variable

  4. Click on edit button

  5. Create a new address, where you have installed python. The default address is C:\\Python34

  6. Save and exit the window

  7. Install Python extension on VScode

  8. Restart VScode

  9. If the problem continues, open command palette ( CTRL + Shift + p )

    9.1. Type Python

    9.2. Select python interpreter from the drop down menu

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