Python 3.6 安装 statsmodels 失败,退出状态为 127

标签 python statsmodels

尝试通过 pip install statsmodels 安装 statsmodels。我正在使用 Win10 和 Python 3.6。我已经安装了 NumPy、SciPy、Pandas 和所有其他依赖项。我安装了带有 C++ 和 Python 相关内容的 Visual Studio Community 2017。 我收到此错误:

    ...

    building 'statsmodels.tsa.kalmanf.kalman_loglike' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\statsmodels
    creating build\temp.win-amd64-3.6\Release\statsmodels\tsa
    creating build\temp.win-amd64-3.6\Release\statsmodels\tsa\kalmanf
    cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Istatsmodels/src -I"c:\program files\python36\lib\site-packages\numpy\core\include" -I"c:\program files\python36\include" -I"c:\program files\python36\include" /Tcstatsmodels/tsa/kalmanf/kalman_loglike.c /Fobuild\temp.win-amd64-3.6\Release\statsmodels/tsa/kalmanf/kalman_loglike.obj

    error: Command "cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Istatsmodels/src -I"c:\program files\python36\lib\site-packages\numpy\core\include" -I"c:\program files\python36\include" -I"c:\program files\python36\include" /Tcstatsmodels/tsa/kalmanf/kalman_loglike.c /Fobuild\temp.win-amd64-3.6\Release\statsmodels/tsa/kalmanf/kalman_loglike.obj" failed with exit status 127

    ----------------------------------------
Command ""c:\program files\python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\me\\AppData\\Local\\Temp\\pip-build-7jsmv60z\\statsmodels\\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\me\AppData\Local\Temp\pip-kpya7eq2-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\me\AppData\Local\Temp\pip-build-7jsmv60z\statsmodels\

引起我注意的是“退出状态为 127 失败”部分,但我找不到与此相关的任何有用信息。

为什么会这样?我能做什么?

最佳答案

我建议使用 AnacondaMiniconda一个非常简单的安装。 Anaconda 带来了所有需要的包。

对于 Miniconda,我建议创建一个环境:

conda create -n py36 python=3.6

激活它:

conda activate py36

并安装你的包:

(py36) conda install numpy scipy pandas statsmodel

关于Python 3.6 安装 statsmodels 失败,退出状态为 127,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44956323/

相关文章:

python - 更新 Kafka 主题中的消息

Python:使用日期时间重置 Pandas.Series 的索引

python - python statsmodel包中的测试和验证

python - python 中 qq-plot(或 probplot)的逐点置信度包络线

python - 如何更改 seaborn violinplot 图例标签?

python - spawnProcess 的简单示例

python - 是否可以让 sqlalchemy 创建一个带有整数部分的复合主键而不使其成为 IDENTITY 类型?

python - 如何使用python脚本安装Django项目requirement.txt

python - Statsmodels 中时间序列的交叉验证

python - StatsModels:返回没有截距的线性回归的预测区间