简体   繁体   English

python:无法在 macbook 终端中打开文件 - [错误 2]!

[英]python: can't open file in macbook terminal - [Errno 2]!

In my macbook air terminal I wrote在我的 macbook air terminal 我写

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$ python: 无法打开文件 'eggshell.py': [Errno 2] 没有这样的文件或目录 s-user:/ user$

After I got that error I tried a number of things, like specifying exactly were eggshell.py is:在我得到那个错误后,我尝试了很多东西,比如准确地指定 eggshell.py 是:

python Users/myuser/Eggshell/eggshell.py

Doing that just gave me a different Errno 2 error:这样做只会给我一个不同的 Errno 2 错误:

OSError: [Errno 2] No such file or directory: 'modules/commands/macOS' OSError: [Errno 2] 没有这样的文件或目录:'modules/commands/macOS'

If you have anything that can help me figure this out, I'd be incredibly grateful, thanks.如果您有任何可以帮助我解决这个问题的东西,我将非常感激,谢谢。 PS I'll attach an image of where the eggshell.py is located PS我会附上eggshell.py所在位置的图片

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. eggshell.py 实际上位于我文档中的一个文件夹中,但它也出现在文档中,所以我真的不知道为什么python eggshell.py不起作用。

截图

You have to be in the directory the eggshell.py was located.您必须位于 eggshell.py 所在的目录中。 (use cd to navigate) (使用cd导航)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OSX终端在启动时给出消息“ Python:无法打开文件'=':[Errno 2]没有这样的文件或目录” - OSX terminal giving the message “Python: can't open file '=': [Errno 2] No such file or directory” upon startup 在 macbook 中,python:[Errno 2] 没有这样的文件或目录 - in macbook, python: [Errno 2] No such file or directory python:无法打开文件'python2':[Errno 2]没有这样的文件或目录 - python: can't open file 'python2': [Errno 2] No such file or directory python:无法打开文件“帮助”:[Errno 2]没有此类文件或目录 - python: can't open file 'help': [Errno 2] No such file or directory python:无法打开文件“C:\\Program”:[Errno 2] 没有这样的文件或目录 - python: can't open file 'C:\Program': [Errno 2] No such file or directory 无法打开文件'python':[Errno 2]没有这样的文件或目录 - can't open file 'python': [Errno 2] No such file or directory python:无法打开文件“ Functions.py”:[Errno 2 - python: can't open file 'Functions.py': [Errno 2 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件 [Errno 2] 没有这样的文件或目录 - Can't Open File [Errno 2 ] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM