无法安装 Statsmodels...python

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38792043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 21:25:59  来源:igfitidea点击:

Unable to install Statsmodels...python

pythonpython-2.7scipypipstatsmodels

提问by Shank

I am using 32 bit cmd, 64 bit windows, python 2.7

我正在使用 32 位 cmd、64 位 Windows、python 2.7

when I type the command pip install statsmodels

当我输入命令 pip install statsmodels

I get the following error for some module of scipy...

对于 scipy 的某些模块,我收到以下错误...

Failed building wheel for Scipy Failed cleaning build dir for scipy

enter image description here

在此处输入图片说明

回答by be_good_do_good

install numpy

安装 numpy

pip install numpy

If you face installation issues for numpy, get the pre-built windows installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/for your python version (python version is different from windows version).

如果您遇到 numpy 的安装问题,请从http://www.lfd.uci.edu/~gohlke/pythonlibs/获取适用于您的 Python 版本(python 版本与 Windows 版本不同)的预构建 Windows 安装程序。

numpy 32-bit: numpy-1.11.1+mkl-cp27-cp27m-win32.whl

numpy 32 位:numpy-1.11.1+mkl-cp27-cp27m-win32.whl

numpy 64-bit: numpy-1.11.1+mkl-cp27-cp27m-win_amd64.whl

numpy 64 位:numpy-1.11.1+mkl-cp27-cp27m-win_amd64.whl

Later you require VC++ 9.0, then please get it from below link Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

稍后您需要 VC++ 9.0,然后请从以下链接获取 Microsoft Visual C++ 9.0 是必需的。从http://aka.ms/vcpython27获取它

Then install

然后安装

Get the pre-built windows installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/for your python version (python version is different from windows version).

http://www.lfd.uci.edu/~gohlke/pythonlibs/获取适用于您的 Python 版本(python 版本与 Windows 版本不同)的预构建 Windows 安装程序。

Scipy 32-bit: scipy-0.18.0-cp27-cp27m-win32.whl

Scipy 32 位:scipy-0.18.0-cp27-cp27m-win32.whl

Scipy 64-bit: scipy-0.18.0-cp27-cp27m-win_amd64.whl

Scipy 64 位:scipy-0.18.0-cp27-cp27m-win_amd64.whl

If it fails saying whl is not supported wheel on this platform , then upgrade pip using python -m pip install --upgrade pipand try installing scipy

如果在此平台上显示不支持 whl 失败,请使用升级 pippython -m pip install --upgrade pip并尝试安装 scipy

Now try

现在试试

pip install scipy

Then try

然后试试

pip install statsmodels

It should work like a charm

它应该像魅力一样工作

回答by kikocorreoso

An easier way to install python libraries on Windows with C/C++/Fortran/... dependencies is to use conda. condais available in MiniCondaor Anacondacontinuum products.

在具有 C/C++/Fortran/... 依赖项的 Windows 上安装 python 库的更简单方法是使用conda. conda可用于MiniCondaAnaconda连续体产品。

Another easy way to install scientific python libraries on windows is to use Christoph Gohlke's windows web page.

在 Windows 上安装科学 Python 库的另一种简单方法是使用Christoph Gohlke 的 windows 网页

If you have no much idea about all of them and how to manage dependencies on windows I recommend you uninstalling your Python and installing anaconda. Anaconda already has Numpy, Scipy, Matplotlib,..., and statsmodels pre-installed (see the list of the packages included in the anaconda distribution).

如果您对所有这些以及如何管理 Windows 上的依赖项都不太了解,我建议您卸载 Python 并安装 anaconda。Anaconda 已经预先安装了Numpy、Scipy、Matplotlib 和 statsmodels (请参阅 anaconda 发行版中包含的软件包列表)

回答by Minh Chau Huynh

I have tried to write this on cmd.exe and it worked.

我试过在 cmd.exe 上写这个,它奏效了。

pip install statsmodels==0.6.0

install statsmodels for python 2.7 in windows

在 Windows 中为 python 2.7 安装 statsmodels

回答by Muhammad Hamza

Make sure you are using the latest version of pipTo check which version you are using try:

确保您使用的是最新版本的pip要检查您使用的是哪个版本,请尝试:

pip --version

To install statsmodels you can either go to cmd.exe or if you are using python pycharm use "Terminal Window" and type:

要安装 statsmodels,您可以转到 cmd.exe,或者如果您使用的是 python pycharm,请使用“终端窗口”并键入:

pip install statsmodels==0.9.0