【问题标题】:build scipy error cythonize failed构建 scipy 错误 cythonize 失败
【发布时间】:2013-02-16 23:33:16
【问题描述】:

我正在尝试构建 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 来纠正这个错误?

【问题讨论】:

    标签: python scipy cython


    【解决方案1】:

    Python setuptools 解决了这个问题。

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

    【讨论】:

    • 将它包含在 scipy 的文档中不是很好吗?
    • 还是作为自动依赖?
    【解决方案2】:

    如果您没有安装 Cython,请使用:pip install Cython。 但是,如果您确实像我一样安装了旧版本的 Cython,那么这就是为我解决的问题:pip install --upgrade Cython

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-07-07
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-11
      • 2016-12-17
      相关资源
      最近更新 更多