r/learnpython • • Oct 23 '26

Python doesn't work in vc

I just want to

print("hello, world")

and it doesn't work

0 Upvotes

25 comments sorted by

View all comments

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

-1

u/anas_mv Oct 23 '26

In the terminalIn the terminal, i write python hello , i got C:\Users\tec\AppData\Local\Python\pythoncore-3.15-64\python.exe: can't open file 'C:\Users\hello.py': [Errno 2] No such file or directory

3

u/eruciform Oct 23 '26

hello.py is not in your current directory of C:\Users\ so it can't find it

either move/save it there or change directory to where your hello.py is and rerun it there

0

u/anas_mv Oct 23 '26

How

2

u/eruciform Oct 23 '26

when you save the file you have to choose where it goes

or on the command line utilize "cd" (change directory) to change where you are

if you can't do either then you need to look up some tutorials on the tool you're using to save or on the command line terminal that you're using

1

u/JGhostThing Oct 23 '26

You need to be in the directory where the file hello.py is. Then "python hello" should work.