【发布时间】:2021-06-21 23:23:41
【问题描述】:
我正在使用python -m <filename> 在 Python 中运行一个文件。但是在——不是之前!——脚本执行期间,我得到了以下异常:
<Path to Python>: Error while finding module specification for 'gentests.py' (ModuleNotFoundError: __path__ attribute not found on 'gentests' while trying to find 'gentests.py'). Try using 'gentests' instead of 'gentests.py' as the module name.
有人知道怎么回事吗?
【问题讨论】:
-
每次收到错误时都要仔细阅读,因为它是为了帮助您而提供的。
标签: python python-import