Home > database >  Cannot import MSTL from statsmodels
Cannot import MSTL from statsmodels

Time:05-31

I am currently trying to import MSTL from statsmodels.tsa.seasonal the module of MSTL (https://www.statsmodels.org/devel/generated/statsmodels.tsa.seasonal.MSTL.html) but it returns an ImportError. I have installed statsmodels from conda on MAC M1 2020

CodePudding user response:

I just had the same issue and did some research. It seems that MSTL is only available on the most recent version of statsmodels: version 0.14.0

If you install statsmodels using conda install -c conda-forge statsmodels, you will get the statsmodels 0.13.2 version.

(Using a script editor, try searching for 'MSTL' through C:\Users{username}\Anaconda3\Lib\site-packages\statsmodels, or wherever statsmodels is installed on your machine, you will probably not find it)

You'll need to install the most recent version from the latest source on statsmodels's github repository: www.statsmodels.org/dev/install.html

From the anaconda prompt:

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

You will need a C compiler and git installed For git you can use: conda install -c anaconda git

Be careful as the installation of the newest version may interfere with your other installed python packages. I would recommend that you use a conda virtual environment for this.

  • Related