建立SciPy的错误cythonize失败(build scipy error cythonize

2019-07-20 20:28发布

我试图建立SciPy的,我也得到抛出一个RuntimeError:

$sudo python setup.py build
Processing scipy/cluster/_vq_rewrite.pyx
Traceback (most recent call last):
  File "tools/cythonize.py", line 172, in <module>
    main()
  File "tools/cythonize.py", line 168, in main
    find_process_files(root_dir)
  File "tools/cythonize.py", line 160, in find_process_files
    process(cur_dir, fromfile, tofile, function, hash_db)
  File "tools/cythonize.py", line 137, in process
    processor_function(fromfile, tofile)
  File "tools/cythonize.py", line 66, in process_pyx
    raise OSError('Cython needs to be installed')
OSError: Cython needs to be installed

Traceback (most recent call last):
  File "setup.py", line 209, in <module>
    setup_package()
  File "setup.py", line 202, in setup_package
    generate_cython()
  File "setup.py", line 147, in generate_cython
    raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!

什么是提供给用Cython纠正这种错误的方法呢?

Answer 1:

Python的setuptools的解决了这个问题。

http://docs.cython.org/src/quickstart/install.html
easy_install cythonpip install cython



Answer 2:

如果你没有再装用Cython确实使用: pip install Cython 。 但是,如果你有一个旧版本的用Cython安装像我那么这就是解决了这个问题对我来说: pip install --upgrade Cython



文章来源: build scipy error cythonize failed