r/learnpython • u/anas_mv • Oct 23 '26
Python doesn't work in vc
I just want to
print("hello, world")
and it doesn't work
0
Upvotes
r/learnpython • u/anas_mv • Oct 23 '26
I just want to
print("hello, world")
and it doesn't work
5
u/Friendly-Repeat4854 Oct 23 '26
What Error Message did you receive ?
My Guess is your Python Interpreter propably isnt the correct one.
3
u/eruciform Oct 23 '26
where did you type it, how did you run it, and what message did you get, there's nowhere near enough information to debug this as is
2
u/Outside_Complaint755 Oct 23 '26
When you invoke Python and tell it to run a script, you need to provide either the correct relative path to the script from your current working directory, or a full absolute path.
Let's say the script hello.py is in
C:\Users\Me\Scripts\Test\hello.pyAnd let's say that when you launch the terminal, it opens to
C:\Users\Me\by default.Then to run your script you can do one of the following:
1
u/samuraisammich Oct 23 '26
Save the file first (there should be no dot next to the tab title at the top if the content of the file is saved)
1
u/ConcreteExist Oct 23 '26
So when you want to run a file with a program like python, you need to give it the actual path to the file.
1
u/andrewgarcia88 28d ago
double check the file is actually saved with a a .py extension and the quotes around hello world are straight quotes not curly ones, some editors autocorrect quotes which breaks the syntax
0
u/OlenaDoubleChecks Oct 23 '26
"vc" as in VS Code? Probably the interpreter isn't selected or Python isn't on PATH. What error do you get when you run it, and are you hitting the run button or typing in the terminal?