简体   繁体   English

无法打开文件 [Errno 2] 没有这样的文件或目录

[英]Can't Open File [Errno 2 ] No such file or directory

I am new to coding and trying to run a python code in vscode using code runner but it doesn't work, I think the issue is that code runner runs C:\/c\/-------- which doesn't exist in my directory, but I don't know how to go about solving it.我是编码新手并尝试使用代码运行器在 vscode 中运行 python 代码,但它不起作用,我认为问题是代码运行器运行 C:\/c\/-------- 这不是存在于我的目录中,但我不知道如何解决它。 screenshot of terminal when I try to run<\/a>我尝试运行时的终端屏幕截图<\/a>

Code in terminal:终端代码:

PS C:\Users\Kevin> python -u "/c/Users/Kevin/Desktop/Coding/Python/testing/hello.py"

C:\Python\Python39\python.exe: can't open file 'C:\c\Users\Kevin\Desktop\Coding\Python\testing\hello.py': [Errno 2] No such file or directory

您可以尝试进入代码运行器设置(@ext:formulahendry.code-runner),打开代码运行器:执行器映射,在 Json 中编辑,然后将“code-runner.terminalRoot”值更改为“”,然后返回设置并取消标记在终端中运行框。

声明:本站的技术帖子网页,遵循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 无法打开文件&#39;file.py&#39;:[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 无法打开文件&#39;menu.py&#39;:[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