Install Cython / Statsmodels

I canโ€™t understand for life how to install batch statsmodels for Python 3. It looks like I tried everything, but nothing works.


Goal: import statsmodels in python

I'll start with:

pip install statsmodels 

Basic error messages:

 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. 

So I'm trying:

 pip install cython 

gives:

 Requirement already satisfied: cython in c:users\XXX\appdata\roaming\python\python36\site-packages 

I installed cython by installing anaconda. I tried almost all the answers that I could find in the main search. But everything does not seem to work.

Instead of listing the input / output of what I tried, I now show only the first steps, but let me know if you want to see the output of any commands.

How do I proceed? Any help is appreciated, I have been trying to fix this for several days now, and I'm just getting upset.


Now I am trying:

 easy_install cython 

It seemed to work, but then pip install statsmodels did not work.

 Command ... failed with error code 1. 

I tried:

 git clone https://github.com/statsmodels/statsmodels cd statsmodels pip install . 

And failed with a bunch of mistakes.

+5
source share
3 answers

I ran into the same problem that was trying to install statsmodels. Finally, what worked with installing the Microsoft Visual C ++ compiler for Python, found here: https://www.microsoft.com/en-gb/download/details.aspx?id=44266 , then installing statsmodels, executing pip installation templates . I have already installed Cython using pip. Although I really understand what it was for Python 2.7. It seems that this compiler is not available for Python 3.

+1
source

To install statsmodels under anaconda, use

 conda install statsmodels 

The package is available in the anacondata repository in version 0.8.0, which is the last at its peak at the moment.

anaconda is not a โ€œsimpleโ€ Python installation, it also contains a conda package manager that can install pre-created packages from the main anaconda repository or from other โ€œchannelsโ€. It is not recommended to install packages available in the anaconda channel using pip, in general.

A comment on the question about Cython is here: to use Cython, your computer also needs a "development environment", that is, the availability of the C compiler, Python development headers, and others. The C compiler must be compatible with the version of Python for which Cython is installed.

0
source

The basic statistical models on PyPI are very old and use non-standard settings. The candidate release for 0.10.0 has already been released, and I highly recommend that you use this one. You can install it using

pip install statsmodels=0.10.0rc2 --pre

It has wheels for all major platforms (Win / OSX / Linux), so you should not see problems with Cython.

0
source

Source: https://habr.com/ru/post/1273330/


All Articles