首页 > 解决方案 > livewires MacOS中“初学者”的模块错误 - 初学者

问题描述

我是 python 的初学者,正在学习一本名为“绝对初学者的 Python 编程”的书,并且在导入 livewires 时遇到了问题。

当我写from livewires import games它时弹出错误:

line 1, in <module>
from livewires import games
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/livewires/__init__.py", line 32, in <module>
from beginners import *
ModuleNotFoundError: No module named 'beginners'

我不知道如何处理这个问题,因为我已经对此进行了研究,但我还没有找到解决方案。

我安装 livewires 的方式(我已经安装了 pygame)

pip install livewires

pip install superwires

标签: pythonmodulemodulenotfounderrorlivewires

解决方案


LiveWires似乎只支持 Python 2。您可以使用SuperWires而不是 LiveWires:

pip3 install superwires
from superwires import games  # Just replace `livewires` with `superwires`
参考

推荐阅读