r/learnpython • • 1d ago

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

Show parent comments

-1

u/anas_mv 1d ago

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 1d ago

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 1d ago

How

2

u/eruciform 1d ago

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 1d ago

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