我下载了cymunk以便在kivent_cymunk上使用它,并且在尝试导入时出现以下错误:

>>> import cymunk
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.7/dist-packages/cymunk/__init__.py", line 1, in <module>
     from .cymunk import *
   File "/usr/local/lib/python2.7/dist-packages/cymunk/cymunk/__init__.py", line 1, in <module>
     from .cymunk import *
 ImportError: No module named cymunk


因此,python在我的main.py中找到了cymunk,但在cymunk.init()中却找不到cymunk。

我正在使用ubuntu 14.04,我像这样安装了cymunk:

daniel@daniel-K54C:/usr/local/lib/python2.7/dist-packages/cymunk$ sudo python setup.py build
running build
running build_py
running build_ext
skipping 'cymunk/cymunk.c' Cython extension (up-to-date)


daniel@daniel-K54C:/usr/local/lib/python2.7/dist-packages/cymunk$ sudo python setup.py check
    running check
    warning: check: missing required meta-data: version, url


daniel@daniel-K54C:/usr/local/lib/python2.7/dist-packages/cymunk$ sudo python setup.py install
    running install
    running build
    running build_py
    running build_ext
    skipping 'cymunk/cymunk.c' Cython extension (up-to-date)
    running install_lib
    running install_egg_info
    Removing /usr/local/lib/python2.7/dist-packages/cymunk-0.0.0.egg-info
    Writing /usr/local/lib/python2.7/dist-packages/cymunk-0.0.0.egg-info


您可能已经意识到所需的肉类数据丢失了。
我不知道那是什么,这是否导致我的问题。

我究竟做错了什么?我该怎么做才能使飞船工作?
感谢您的帮助,谢谢!!

最佳答案

根据生成的输出,您错误地将“ cymunk”源提取到了/usr/local/lib/python2.7/dist-packages/cymunk中。

您不应将源提取到/usr/local/lib/python2.7/dist-packages / ...中,在这种情况下,源目录“名称”与随站点软件包安装的库名冲突。

固定:

rm -rf /usr/local/lib/python2.7/dist-packages/cymunk
extract and rebuild from your home dir

10-06 08:50