简体   繁体   English

FileNotFoundError:[错误2]没有此类文件或目录。 的Ubuntu

[英]FileNotFoundError: [Errno 2] No such file or directory. Ubuntu

My script is on a server running ubuntu 16.04. 我的脚本在运行ubuntu 16.04的服务器上。 I want this script to collect some results in the csv file. 我希望此脚本在csv文件中收集一些结果。 for this I: 为此,我:

with open('./folder/tickets.csv', 'w', encoding='utf-8') as ouf:
    for i in d:
        i = str(i)
        ouf.write(i + '\n')

as a result, I get an error: FileNotFoundError: [Errno 2] No such file or directory: './folder/tickets.csv' 结果,我得到一个错误:FileNotFoundError:[Errno 2]没有这样的文件或目录:'./folder/tickets.csv'

I tried to specify the absolute path (/home/root/folder/tickets.csv), but the error is still the same 我尝试指定绝对路径(/home/root/folder/tickets.csv),但错误仍然相同

tell me what is wrong? 告诉我怎么了?

the question is closed. 这个问题已经解决。 having tried the path again '/root/folder' everything worked 再次尝试了路径'/ root / folder'一切正常

暂无
暂无

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

相关问题 FileNotFoundError: [Errno 2] 没有这样的文件或目录。 Python 无法正确读取文件 - FileNotFoundError: [Errno 2] No such file or directory. Python not reading files correctly Pillow 不会在同一目录中打开图像。 “FileNotFoundError:[Errno 2] 没有这样的文件或目录:” - Pillow won't open an image in the same directory. “FileNotFoundError: [Errno 2] No such file or directory:” FileNotFoundError [Errno 2] 没有这样的文件或目录: - FileNotFoundError [Errno 2] No such file or directory: FileNotFoundError: [Errno 2] 没有这样的文件或目录? - FileNotFoundError: [Errno 2] No such file or directory? FileNotFoundError:[Errno 2]没有这样的文件或目录: - FileNotFoundError: [Errno 2] No such file or directory: FileNotFoundError:没有这样的文件或目录。 即使它存在 - FileNotFoundError: No such file or directory. Even though it exists FileNotFoundError:[错误2]没有这样的文件或目录,但是文件在那里 - FileNotFoundError: [Errno 2] No such file or directory, But the file is there FileNotFoundError: [Errno 2] 没有这样的文件或目录,但有一个文件 - FileNotFoundError: [Errno 2] No such file or directory but there is a file FileNotFoundError: [Errno 2] 没有这样的文件或目录:'ifconfig' - FileNotFoundError: [Errno 2] No such file or directory: 'ifconfig' 错误:FileNotFoundError:[Errno 2] 没有这样的文件或目录 - Bad: FileNotFoundError: [Errno 2] No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM