VSCode not running Python

24,540

Solution 1

Maybe there is problem with your interpreter.

Try this: ctrl+shift+p -> Python: Select Interpreter -> select your path (C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe)

https://code.visualstudio.com/docs/python/environments

Solution 2

If you have installed Python from an executable file and not from the Windows Store, you can change your terminal setting from internal to external and make cmd as the default terminal in Visual Studio Code.

You can directly edit those setting from settings.json:

"terminal.explorerKind": "external",
"terminal.integrated.defaultProfile.windows": "Command Prompt"
Share:
24,540

Related videos on Youtube

Tim.Kaz
Author by

Tim.Kaz

HTML, CSS, JS, C++, Python Schwiizerdüütsch, Deutsch, Russky, English, Français, Esperanto, Español, Medzuslovjanski

Updated on May 06, 2022

Comments

  • Tim.Kaz
    Tim.Kaz about 2 years

    I'm using the newest version of VSCODE and Python 3.6 (64bit) on Windows 10.

    I have the "Python" extension installed (the one made by Microsoft).

    Every time I try to run a simple program [e.g: print("Hello World")] it says that "The command "python" wasn't spelled correctly or couldn't be found"! [Done] exited with code=1 in 0.034 seconds

    It's a very simple Hello World program that doesn't really need much. WHY is VSCODE not letting me run a Python file?

    This is where my Python is stored:

    C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe

    • Tim.Kaz
      Tim.Kaz over 4 years
      If you need more information or screenshots I'll be happy to provide you with them.
    • OneCricketeer
      OneCricketeer over 4 years
      Have you tried editing your PATH to include python.exe?
    • Brett Cannon
      Brett Cannon over 4 years
      It appears you have the Code Runner extension installed and that's what's not working, not the Python extension from Microsoft (the [Done] is a tell-tale sign).