我下载了花栗鼠在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中找到了花栗鼠,但它没有在花栗鼠中找到花栗鼠。 init ()。
我正在使用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
您可能已经认识到缺少所需的肉类数据。 我不知道那是什么,如果这是导致我的问题。
我做错了什么?我能做些什么来让花栗鼠工作? 我感谢任何帮助,谢谢!
答案 0 :(得分:2)
根据您的构建输出,您错误地提取了&#34; cymunk&#34;源于/usr/local/lib/python2.7/dist-packages/cymunk。
您不应该将源提取到/usr/local/lib/python2.7/dist-packages / ...,在这种情况下,源目录&#34; name&#34;与使用site-packages安装的库名冲突。
修正:
rm -rf /usr/local/lib/python2.7/dist-packages/cymunk
extract and rebuild from your home dir