Repository navigation
Description
I am getting below error
ModuleNotFoundError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\statsmodels\compat\pandas.py in ()
52 try:
---> 53 import pandas.tseries.tools as datetools
54 import pandas.tseries.frequencies as frequencies
ModuleNotFoundError: No module named 'pandas.tseries.tools'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in ()
----> 1 import statsmodels.api as sm
~\Anaconda3\lib\site-packages\statsmodels\api.py in ()
5 from . import regression
6 from .regression.linear_model import OLS, GLS, WLS, GLSAR
----> 7 from .regression.recursive_ls import RecursiveLS
8 from .regression.quantile_regression import QuantReg
9 from .regression.mixed_linear_model import MixedLM
~\Anaconda3\lib\site-packages\statsmodels\regression\recursive_ls.py in ()
14 from statsmodels.regression.linear_model import OLS
15 from statsmodels.tools.data import _is_using_pandas
---> 16 from statsmodels.tsa.statespace.mlemodel import (
17 MLEModel, MLEResults, MLEResultsWrapper)
18 from statsmodels.tools.tools import Bunch
~\Anaconda3\lib\site-packages\statsmodels\tsa\statespace\mlemodel.py in ()
15 from .kalman_filter import (KalmanFilter, FilterResults, INVERT_UNIVARIATE,
16 SOLVE_LU)
---> 17 import statsmodels.tsa.base.tsa_model as tsbase
18 import statsmodels.base.wrapper as wrap
19 from statsmodels.tools.numdiff import (_get_epsilon, approx_hess_cs,
~\Anaconda3\lib\site-packages\statsmodels\tsa\base\tsa_model.py in ()
1 from statsmodels.compat.python import lrange, long
----> 2 from statsmodels.compat.pandas import is_numeric_dtype
3
4 import datetime
5
~\Anaconda3\lib\site-packages\statsmodels\compat\pandas.py in ()
54 import pandas.tseries.frequencies as frequencies
55 except ImportError:
---> 56 from pandas.core import datetools
57 frequencies = datetools
ImportError: cannot import name 'datetools'
Activity
lwsdegithub commentedon Apr 24, 2019
so what?
you can just reinstall the pandas
saurabhkumar27 commentedon Apr 24, 2019
reinstalling pandas doesn't sort my error, as it says to install datetools
jvanneck commentedon May 2, 2019
Me too, it happened to me after I moved to the latest version of pandas (pandas==0.24.2), I was on 0.23.2 before I think and it was working.
bashtage commentedon May 2, 2019
You are probably running 0.9, which is quite old. If you upgrade to statsmodels master this is fixed (assuming you have a compiler,
pip install git+https://github.com/statsmodels/statsmodelswill install the latest master). If you cannot upgrade to the latest statsmodels, you will need to use an older version of pandas.bashtage commentedon May 9, 2019
Closing. Will be fixed when the next release is out.
akhiljamdar commentedon Apr 3, 2020
getting error while import stdecompose library ///--
ImportError Traceback (most recent call last)
in ()
----> 1 from stldecompose import decompose, forecast
~/anaconda3/lib/python3.6/site-packages/stldecompose/init.py in ()
----> 1 from .stl import decompose, forecast
~/anaconda3/lib/python3.6/site-packages/stldecompose/stl.py in ()
4 from statsmodels.tsa.seasonal import DecomposeResult
5 from statsmodels.tsa.filters._utils import _maybe_get_pandas_wrapper_freq
----> 6 import statsmodels.api as sm
7
8
~/anaconda3/lib/python3.6/site-packages/statsmodels/api.py in ()
9 from . import regression
10 from .regression.linear_model import OLS, GLS, WLS, GLSAR
---> 11 from .regression.recursive_ls import RecursiveLS
12 from .regression.quantile_regression import QuantReg
13 from .regression.mixed_linear_model import MixedLM
~/anaconda3/lib/python3.6/site-packages/statsmodels/regression/recursive_ls.py in ()
9 import pandas as pd
10
---> 11 from statsmodels.compat.pandas import Appender
12
13 from statsmodels.tools.data import _is_using_pandas
ImportError: cannot import name 'Appender'
bashtage commentedon Apr 3, 2020
What pandas do you have installed? Have a look at closed issues. This has appeared in another thread.
hafez-ahmad commentedon Apr 7, 2020
File "", line 7, in
from statsmodels.tsa.api import VAR, DynamicVAR
ImportError: cannot import name 'DynamicVAR' from 'statsmodels.tsa.api' (C:\Users\hafez\anaconda3\lib\site-packages\statsmodels\tsa\api.py)
bashtage commentedon Apr 7, 2020
Please upgrade to the latest release. DynamicVAR isn't in it.
cocolilian commentedon May 26, 2020
Hello,I followed this method(pip install git+https://github.com/statsmodels/statsmodels.git) and have been waited for a long time(like hours). I wonder how long should I wait before it is done?
Below are what is going on on my screen:
Collecting git+https://github.com/statsmodels/statsmodels.git
Cloning https://github.com/statsmodels/statsmodels.git to /tmp/pip-req-build-1pwouxyr
Running command git clone -q https://github.com/statsmodels/statsmodels.git /tmp/pip-req-build-1pwouxyr
bashtage commentedon May 26, 2020
Assuming you have a reasonable internet connection and a relatively modern computer, it should all finish in a couple of minutes.
cocolilian commentedon May 26, 2020
Thank you.But it seems not work for me,I waited for some time.There is another question now,it signaled 'cannot import name 'factorial' from 'scipy.misc' (/opt/conda/lib/python3.7/site-packages/scipy/misc/init.py)' when I entered 'from statsmodels.formula.api import ols'.The package is already installed.And if I enter 'import statsmodels',no warnings appear.How to do with it?
bashtage commentedon May 26, 2020
You have very old statsmodels that is not supported. You should be using Python 3 (probably 3.7 or 3.8) to get a working copy of statsmodels.
bashtage commentedon May 26, 2020
If you are not sure what you are doing, please use Anaconda.
cocolilian commentedon May 26, 2020
I am working on a JupyterLab link which offered by a contest, and I think I can hardly copy data from it .Perhaps I am not getting used to it.When using JupyterLab, there is no 'cmd' to 'pip packages' easily.
bashtage commentedon May 26, 2020
You need to get support from the people running the competition.
cocolilian commentedon May 26, 2020
Yes,I will.Thanks for your help!
vinit2shah commentedon Sep 16, 2020
I have statsmodels version 0.13.0 using pip install git+https://github.com/statsmodels/statsmodels. I have Visuall C++ version 14.0.
But still I can't import statsmodels.api.
THis is what I get:
ImportError Traceback (most recent call last)
in ()
1 import numpy as np
2 from numba import njit
----> 3 import statsmodels.api as sm
4 import matplotlib.pyplot as plt
5 get_ipython().magic('matplotlib inline')
~\Anaconda3\lib\site-packages\statsmodels\api.py in ()
9 from . import regression
10 from .regression.linear_model import OLS, GLS, WLS, GLSAR
---> 11 from .regression.recursive_ls import RecursiveLS
12 from .regression.quantile_regression import QuantReg
13 from .regression.mixed_linear_model import MixedLM
~\Anaconda3\lib\site-packages\statsmodels\regression\recursive_ls.py in ()
12
13 from statsmodels.tools.data import _is_using_pandas
---> 14 from statsmodels.tsa.statespace.mlemodel import (
15 MLEModel, MLEResults, MLEResultsWrapper, PredictionResults,
16 PredictionResultsWrapper)
~\Anaconda3\lib\site-packages\statsmodels\tsa\statespace\mlemodel.py in ()
34 from .kalman_filter import INVERT_UNIVARIATE, SOLVE_LU, MEMORY_CONSERVE
35 from .initialization import Initialization
---> 36 from .tools import prepare_exog, concat
37
38
ImportError: cannot import name 'prepare_exog'
bashtage commentedon Sep 16, 2020
Can you install 0.12.0 correctly?
vinit2shah commentedon Sep 16, 2020
Sorry, issue solved. forgot to restart the kernel