Python版本:3.10
我试图使用以下pip命令安装freegamespython包
C:\Users\praty>pip install freegames
Defaulting to user installation because normal site-packages is not writeable
Collecting freegames
Downloading freegames-2.3.2-py2.py3-none-any.whl (108 kB)
|████████████████████████████████| 108 kB 504 kB/s
Installing collected packages: freegames
Successfully installed freegames-2.3.2
但是在我的python环境中导入相同的代码时,我遇到了这个错误
C:\Users\praty>python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import freegames
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\praty\AppData\Roaming\Python\Python310\site-packages\freegames\_init_.py", line 61, in <module>
from .utils import floor, line, path, square, vector
File "C:\Users\praty\AppData\Roaming\Python\Python310\site-packages\freegames\utils.py", line 77, in <module>
class vector(collections.Sequence):
AttributeError: module 'collections' has no attribute 'Sequence'
如何解决相同的问题
在相当长的一段时间内
Sequence
可以从collections
导入:从Python3.7开始,出现了一条警告,该类已移动到
collections.abc
:在Python 3.10中,这变成了一个错误:
将问题报告给
freegames
的作者。降级到Python 3.9。了解您永远不应该如此快速地升级到最新和最好的版本相关问题 更多 >
编程相关推荐