7

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

when I type the command pip install statsmodels

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

Failed building wheel for Scipy Failed cleaning build dir for scipy

enter image description here

be_good_do_good
  • 4,311
  • 3
  • 28
  • 42
Shank
  • 665
  • 3
  • 9
  • 21
  • see this: http://stackoverflow.com/questions/28190534/windows-scipy-install-no-lapack-blas-resources-found also this https://icl.cs.utk.edu/lapack-for-windows/lapack/ – Ale Aug 05 '16 at 14:51
  • So for installing LAPACK for windows 8 do I need to have Visual Studio – Shank Aug 05 '16 at 15:01
  • Use a package like conda/anaconda or winpython or use the gohlke binaries. Trying to compile scipy on Windows (which also requires a Fortran compiler) is just a waste of time unless you're an expert. – Josef Aug 05 '16 at 15:13
  • 2
    don't copy images of text please – noɥʇʎԀʎzɐɹƆ Aug 05 '16 at 15:54

4 Answers4

7

install 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 32-bit: numpy-1.11.1+mkl-cp27-cp27m-win32.whl

numpy 64-bit: 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

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).

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

Scipy 64-bit: 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 pip and try installing scipy

Now try

pip install scipy

Then try

pip install statsmodels

It should work like a charm

Maximilian Peters
  • 30,348
  • 12
  • 86
  • 99
be_good_do_good
  • 4,311
  • 3
  • 28
  • 42
  • 3
    @Shank please use proper spelling, grammar, and punctuation. – noɥʇʎԀʎzɐɹƆ Aug 05 '16 at 15:55
  • I'm getting "Cython is required to compile statsmodels from a development branch. Please install Cython or download a source release of statsmodels." error. Strange thing is I've already installed Cython. – Capan Feb 02 '18 at 17:57
6

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

pip install statsmodels==0.6.0

install statsmodels for python 2.7 in windows

5

An easier way to install python libraries on Windows with C/C++/Fortran/... dependencies is to use conda. conda is available in MiniConda or Anaconda continuum products.

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

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).

ericmjl
  • 13,541
  • 12
  • 51
  • 80
kikocorreoso
  • 3,999
  • 1
  • 17
  • 26
  • I dont have c/c++/fortran/ on my pc.... I just want to run regression and thought statsmodels.api is the best somehow pandas.stats.api is also giving error – Shank Aug 05 '16 at 15:18
  • 1
    You don't need it, Anaconda deals with that for you :-D – kikocorreoso Aug 05 '16 at 15:35
1

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

pip --version

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

pip install statsmodels==0.9.0
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114