我这辈子都想不出如何为 Python 3 安装包 statsmodels。感觉我已经尝试了一切,但没有任何效果。
目标:在 python 中导入 statsmodels
我开始于:
pip install statsmodels
主要错误信息:
Failed bulding wheel for statsmodels.
Cython is required to compile statsmodels from a development branch.
Please install Cython or download a source release of statsmodels.
所以我尝试:
pip install cython
给予:
Requirement already satisfied: cython in c:users\XXX\appdata\roaming\python\python36\site-packages
我是通过安装anaconda来安装cython的。我已经尝试了几乎所有可以通过基本谷歌搜索找到的答案。但事情似乎并没有奏效。
我现在只显示第一步,而不是列出我尝试过的输入\输出,但如果您想查看任何命令的输出,请告诉我。
我如何从这里继续?感谢任何帮助,我已经尝试解决这个问题好几天了,但我只是感到沮丧。
现在我正在尝试:
easy_install cython
这似乎有效,但之后 pip install statsmodels 无效。
Command ... failed with error code 1.
我试过:
git clone https://github.com/statsmodels/statsmodels
cd statsmodels
pip install .
并因一堆错误而失败。
最佳答案
昨晚我在尝试安装 statsmodels 时遇到了同样的问题。最后,有效的是为 Python 安装 Microsoft Visual C++ 编译器,可在此处找到:https://www.microsoft.com/en-gb/download/details.aspx?id=44266然后通过执行 pip install statsmodels 安装 statsmodels。我已经使用 pip 安装了 Cython。虽然我知道那是针对 Python 2.7 的。似乎没有适用于 Python 3 的编译器。
关于python - 安装 Cython/Statsmodels,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47272715/