安装Cython时无法导入名称ContextualZipFile

时间:2015-08-17 19:20:12

标签: python cython

我下载了Cython并运行:

sudo python setup.py install

我收到以下错误:

Unable to find pgen, not compiling formal grammar.
running install
Traceback (most recent call last):
  File "setup.py", line 357, in <module>
    **setup_args
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py", line 98, in do_egg_install
    easy_install = self.distribution.get_command_class('easy_install')
  File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 388, in get_command_class
    self.cmdclass[command] = cmdclass = ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 42, in <module>
    from setuptools.archive_util import unpack_archive
  File "/usr/local/lib/python2.7/dist-packages/setuptools/archive_util.py", line 15, in <module>
    from pkg_resources import ensure_directory, ContextualZipFile
ImportError: cannot import name ContextualZipFile

使用pip install安装时也会出现同样的错误。

0 个答案:

没有答案