Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code not running Python

I'm using the newest version of Visual Studio Code and Python 3.6 (64 bit) 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 Visual Studio Code not letting me run a Python file?

This is where my Python executable is stored:

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe
like image 395
Tim.Kaz Avatar asked Jun 10 '26 22:06

Tim.Kaz


1 Answers

Maybe there is problem with your interpreter.

Try this: Ctrl + Shift + PPython: Select Interpreter → select your path (C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe)

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

like image 102
Kezif Garbian Avatar answered Jun 12 '26 11:06

Kezif Garbian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!