python:无法在Macbook终端中打开文件-[Errno 2]! [英] python: can't open file in macbook terminal - [Errno 2]!

查看:110
本文介绍了python:无法在Macbook终端中打开文件-[Errno 2]!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Macbook航站楼上写过

In my macbook air terminal I wrote

python eggshell.py

但是我遇到了这个错误

python:无法打开文件'eggshell.py':[Errno 2]没有此类文件或目录s-user:/用户$

python: can't open file 'eggshell.py': [Errno 2] No such file or directory s-user:/ user$

在收到该错误后,我尝试了很多事情,例如确切地指定eggshell.py为:

After I got that error I tried a number of things, like specifying exactly were eggshell.py is:

python Users/myuser/Eggshell/eggshell.py

这样做给了我一个不同的Errno 2错误:

Doing that just gave me a different Errno 2 error:

OSError:[Errno 2]没有这样的文件或目录:'模块/命令/macOS'

OSError: [Errno 2] No such file or directory: 'modules/commands/macOS'

如果您有什么可以帮助我解决这个问题的方法,我将非常感激,谢谢.附言:我将附上eggshell.py所在位置的图片

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实际上位于文档的文件夹中,但是它也显示在文档中,所以我真的不知道为什么 python 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所在的目录中.(使用 cd 进行导航)

You have to be in the directory the eggshell.py was located. (use cd to navigate)

这篇关于python:无法在Macbook终端中打开文件-[Errno 2]!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆