Im so tired with this, time after time my files just dont work, when i try to read a file from my code, it just doesent find it, ive checked always for typos and i uploaded my code here ones and everyone said it should run smoothly but it just doesent find the file, the same thing has happened with other peoples code that works perfectly for them but for me it just doesent find it. its fine now because some guy told me to use some pathlib thing but now my problem is that i try to import my project with pyinstaller but when i do this: pyinstaller main.py --onefile, it says it cant find main.py file even tho i am literally running the command the terminal of a file called main.py. PLEASE HELP
#π My files just dont work again
12 messages Β· Page 1 of 1 (latest)
@short mural
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
im coding in visual studio, is there some kind of setting that i have to turn on to allow visual studio to read my files
*vscode sorry
are you sure that you are running the program in the correct directory? if you run python -c 'import os;print(os.listdir())' (or just os.listdir in your script) does it show the files you expect it to? 
wait so what do i have to run and where? also the terminal im using is returning the stuff i print in my main.py file so im pretty sure im in the correct terminal
it's just a python command you run in the terminal
this: ```At line:2 char:32
- -c 'import os;print(os.listdir())
-
~
An expression was expected after '('.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedExpressionis what its saying when i run this: -c 'import os;print(os.listdir())```
you appears that you left out part of the command so it failed:
$ python -c "..." # note the quotes as well
another potential issue is if you're using relative paths instead of absolute paths. generally abs paths won't break if your working directory changes
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.