简体   繁体   English

我收到错误消息 ImportError: cannot import name 'onetime_file'" while import a python file

[英]I am getting error message ImportError: cannot import name 'onetime_file'" while import a python file

我正在尝试从配置文件夹导入 onetime_file 但收到错误消息“导入错误:无法导入名称‘onetime_file’”

sorry i can not comment the post yet.抱歉,我还不能评论该帖子。 How did you tried to open the file?你是如何尝试打开文件的? The standard way is:标准方法是:

with open(PATH_FILE, 'r') as file:

Did you check the path was correct?您检查路径是否正确? Did you tried to put the absolute path instead of the relative one?您是否尝试放置绝对路径而不是相对路径? Is your file writable or readable?您的文件是否可写或可读?

暂无
暂无

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

相关问题 为什么我会收到此导入错误? ImportError:无法从“social_django.utils”导入名称“setting” - Why am I getting this Import Error? ImportError: cannot import name 'setting' from 'social_django.utils' 为什么我在 Python 中收到错误消息“无法导入名称 NoneType”? - Why am I getting an error message in Python 'cannot import name NoneType'? python ggplot错误消息ImportError:无法导入名称'TimeSeries'' - python ggplot Error message ImportError: cannot import name 'TimeSeries' ' 获取python ImportError:无法导入名称'appengine' - Getting python ImportError: cannot import name 'appengine' 导入错误:导入串行时无法导入名称属性 python 错误 - ImportError: cannot import name properties python error while importing serial 安装时出现“importError:无法导入名称'main'”错误 - while installing i'm getting "importError: cannot import name 'main'" error ImportError:从 C++ 运行 python 文件时,无法在 Visual Studio 调试控制台中导入名称“etree” - ImportError: cannot import name 'etree' in Visual Studio Debug console while running python file from C++ Python错误:ImportError:无法导入名称Akismet - Python error: ImportError: cannot import name Akismet Python 错误 - “导入错误:无法导入名称‘dist’” - Python error - “ImportError: cannot import name 'dist'” Python错误:“ ImportError:无法导入名称isat” - Python error: “ImportError: cannot import name isnat”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM