简体   繁体   English

无法打开文件:[Errno 2] 没有那个文件或目录

[英]can't open file : [Errno 2] No such file or directory

seohyun3545@tpu-vm:~$ python3 tomato.py

python3: can't open file '/home/seohyun3545/tomato.py': [Errno 2] No such file or directory python3: 无法打开文件 '/home/seohyun3545/tomato.py': [Errno 2] 没有那个文件或目录

I cannot run python on the cloud shell. Since I used pwd to check current directory, I'm sure that 'tomato.py' is in the same directory('/home/seohyun3545').我无法在云 shell 上运行 python。因为我使用 pwd 来检查当前目录,我确定'tomato.py'在同一目录('/home/seohyun3545')中。 How can I solve this problem?我怎么解决这个问题?

I guess it's related with TPU because there was nothing wrong when I didn't connect to TPU.我猜是跟TPU有关,因为我不接TPU的时候也没什么问题。 [enter image description here](https://i.stack.imgur enter image description here .com/zMzvj.png) [在此处输入图片描述](https://i.stack.imgur在此处输入图片描述.com/zMzvj.png)

It shouldn't be TPU related issue.它不应该是 TPU 相关的问题。

You could try two ways below to see if tomato.py is in this current directory:您可以尝试以下两种方式来查看tomato.py是否在当前目录中:

  1. Run ls -lh , and see if tomato.py is there.运行ls -lh ,看看tomato.py是否存在。
  2. Run test -f tomato.py; echo $?运行test -f tomato.py; echo $? test -f tomato.py; echo $? . . If it returns code 1, that means tomato.py file does not exist.如果它返回代码 1,则表示tomato.py文件不存在。

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

相关问题 无法打开文件:[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 无法打开文件'file.py':[Errno 2] 没有这样的文件或目录 - Can't open file 'file.py': [Errno 2] No such file or directory python:无法打开文件“帮助”:[Errno 2]没有此类文件或目录 - python: can't open file 'help': [Errno 2] No such file or directory 无法打开文件'menu.py':[Errno 2]没有这样的文件或目录 - Can't open file 'menu.py': [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 无法打开文件'.manage.py':[Errno 2] 没有这样的文件或目录 - can't open file '.manage.py': [Errno 2] No such file or directory 无法打开文件'/c':[Errno 2] 没有这样的文件或目录 - can't open file '/c': [Errno 2] No such file or directory 无法打开文件“audioAnalysis.py”:[Errno 2] 没有这样的文件或目录 - Can't open file 'audioAnalysis.py': [Errno 2] No such file or directory 无法打开文件 'app.py': [Errno 2] 没有那个文件或目录 - can't open file 'app.py': [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM