1

我尝试安装pymunk,但安装验证测试 ( python -m pymunk.tests test) 失败:

>python -m pymunk.tests test
Traceback (most recent call last):
  File "C:\Users\ayrto\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Users\ayrto\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\ayrto\pymunk.py", line 4, in <module>
    space = pymunk.Space()      # Create a Space which contain the simulation
AttributeError: partially initialized module 'pymunk' has no attribute 'Space' (most likely due to a circular import) 

我在 Win 10 中运行 Python 3.8.3。

pymunk版本:

pip install pymunk
Requirement already satisfied: pymunk in c:\users\\appdata\local\programs\python\python38\lib\site-packages (5.6.0)
Requirement already satisfied: cffi!=1.13.1 in c:\users\\appdata\local\programs\python\python38\lib\site-packages (from pymunk) (1.14.0)
Requirement already satisfied: pycparser in c:\users\\appdata\local\programs\python\python38\lib\site-packages (from cffi!=1.13.1->pymunk) (2.20)

4

1 回答 1

4

您有一个名为“pymunk.py”的本地文件。那是被导入而不是pymunk。将您的文件名更改为其他名称。

于 2020-07-14T07:18:11.157 回答