问题
In my macbook air terminal I wrote
python eggshell.py
but I got this error
python: can't open file 'eggshell.py': [Errno 2] No such file or directory s-user:/ user$
After I got that error I tried a number of things, like specifying exactly were eggshell.py is:
python Users/myuser/Eggshell/eggshell.py
Doing that just gave me a different Errno 2 error:
OSError: [Errno 2] No such file or directory: 'modules/commands/macOS'
If you have anything that can help me figure this out, I'd be incredibly grateful, thanks. P.S I'll attach an image of where the eggshell.py is located
eggshell.py is actually located in a folder in my documents, but it shows up in the documents too, so I really don't know why python eggshell.py
doesn't work.
回答1:
You have to be in the directory the eggshell.py was located. (use cd
to navigate)
来源:https://stackoverflow.com/questions/46814874/python-cant-open-file-in-macbook-terminal-errno-2