无法使用Pip下载软件包:说Cython没有安装

时间:2017-07-21 08:48:27

标签: python installation pip cython

我正在尝试使用pip在我的Windows 10系统上下载pyahocorasick包。 在我的命令行上,我写了

pip install pyahocorasick

它给出了以下输出 -

Collecting pyahocorasick
  Using cached pyahocorasick-1.1.4.tar.bz2
Installing collected packages: pyahocorasick
  Running setup.py install for pyahocorasick ... error
    Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    failed to import Cython: DLL load failed: %1 is not a valid Win32 application.
    error: Cython does not appear to be installed

    ----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Krishna\AppData\Local\Temp\pip-build-b7a1mq0t\pyahocorasick\

然后我试着看看是否实际安装了Cython,所以我写了 -

Cython version

,输出为 -

Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\cython.exe\__main__.py", line 5, in <module>
  File "C:\Python34\lib\site-packages\Cython\Compiler\Main.py", line 28, in <module>
    from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: %1 is not a valid Win32 application.

最后我尝试了 -

install Cython

输出是 -

Requirement already satisfied: Cython in c:\python34\lib\site-packages

所以我的问题是 - 如果已安装Cython,为什么安装包pyahocorasick会出错 - Cython does not appear to be installed?我该如何解决这个问题?

0 个答案:

没有答案