运行Cython的问题

时间:2012-09-15 17:24:20

标签: c++ python cython

我正在尝试使用运行Mountain Lion的OSX安装Python2.7运行cython但是我收到以下错误:

Traceback (most recent call last):
File "/usr/local/bin/cython", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: Cython==0.17

我该如何解决这个问题?

谢谢!

1 个答案:

答案 0 :(得分:0)

可能发生的事情是你用一个版本的python安装了cython并试图用另一个版本运行它。而不是做标准

python setup.py build
sudo python setup.py install

尝试使用显式版本的python切换到root并构建和安装:

sudo su
/usr/bin/python setup.py build
/usr/bin/python setup.py install

(请注意,这一切都假设您正在从源tarball安装)。