【问题标题】:RuntimeError: Running cythonize failed! Statsmodels installationRuntimeError:运行 cythonize 失败!统计模型安装
【发布时间】:2018-05-17 11:25:35
【问题描述】:

当我从cmdStatsmodels 的源克隆运行python setup.py 时,它会抛出错误,尽管安装的 Cython 是 cython.version '0.27.3'

statsmodels-master>python setup.py install
Cythonizing sources
Processing statsmodels\nonparametric\linbin.pyx
Fatal error in launcher: Unable to create process using '"'
Traceback (most recent call last):
  File "C:\Users\Test\statsmodels-master\tools\cythonize.py", line 215, in <module>
    main()
  File "C:\Users\Test\statsmodels-master\tools\cythonize.py", line 211, in main
    find_process_files(root_dir)
  File "C:\Users\Test\statsmodels-master\tools\cythonize.py", line 203, in find_process_files
    process(cur_dir, fromfile, tofile, function, hash_db)
  File "C:\Users\Test\statsmodels-master\tools\cythonize.py", line 174, in process
    processor_function(fromfile, tofile)
  File "C:\Users\Test\statsmodels-master\tools\cythonize.py", line 72, in process_pyx
    raise Exception('Cython failed')
Exception: Cython failed
Traceback (most recent call last):
  File "setup.py", line 546, in <module>
    generate_cython()
  File "setup.py", line 90, in generate_cython
    raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!

任何帮助将不胜感激。 提前致谢。

【问题讨论】:

  • 问之前有没有试过调试?
  • 这听起来像是你传递给它一个带引号的路径,而它需要一个不带引号的路径。
  • 你需要在打印"Unable to create process using"的那一行设置一个断点,猜测变量值有什么问题,然后将错误的值追踪到它的原点。
  • 我从 statsmodel master github 存储库 git://github.com/statsmodels/statsmodels.git 运行这个文件。
  • 当尝试在cmd中使用pip安装时,抛出异常:Cython-generated file 'statsmodels/tsa/regime_switching/_hamilton_filter.c' not found. Cython is required to compile statsmodels from a development branch. Please install Cython or download a source release of statsmodels. 虽然我已经安装了0.27.3版本的Cython,python版本是3.5.3

标签: python python-3.x machine-learning cython statsmodels


【解决方案1】:

我认为错误是setup.py 文件的路径与您的python 包依赖文件的路径不匹配。

您可以使用这种方式安装它,而不是使用源代码。

sudo su
your password
pip install statsmodels

【讨论】:

  • 您能否为您的答案添加一些解释并更好地格式化它?
  • 我在上面编辑了我的答案。如果您有任何其他问题,请告诉我@Mehdi
猜你喜欢
  • 1970-01-01
  • 2020-10-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-24
  • 1970-01-01
  • 2017-11-01
  • 1970-01-01
相关资源
最近更新 更多