[英]Python/Jupyter Notebook Not finding modules...?
I just got done writing a pretty good rock paper scissors game and now when I try to import it and run the cell I'm getting this:我刚刚写了一个很好的石头剪刀布游戏,现在当我尝试导入它并运行单元格时,我得到了这个:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-7-8d3be5084430> in <module>
----> 1 import RPSgame.py
ModuleNotFoundError: No module named 'RPSgame.py'; 'RPSgame' is not a package
What is causing this and how can I fix it?这是什么原因造成的,我该如何解决? I'm running Jupyter Notebook through Anaconda Navigator
我正在通过 Anaconda Navigator 运行 Jupyter Notebook
这可能与您如何导入 .py 文件有关此链接可能会有所帮助: 如何导入其他 Python 文件?
你应该试试这个:
import .RPSgame
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.