bash-3.2$ pip3 install -U statsmodels
Collecting statsmodels
Requirement not upgraded as not directly required: pandas in /usr/local/lib/python3.7/site-packages (from statsmodels) (0.23.3)
Requirement not upgraded as not directly required: patsy in /usr/local/lib/python3.7/site-packages (from statsmodels) (0.5.0)
Requirement not upgraded as not directly required: scipy in /usr/local/lib/python3.7/site-packages (from statsmodels) (1.1.0)
Requirement not upgraded as not directly required: python-dateutil>=2.5.0 in /usr/local/lib/python3.7/site-packages (from pandas->statsmodels) (2.7.3)
Requirement not upgraded as not directly required: pytz>=2011k in /usr/local/lib/python3.7/site-packages (from pandas->statsmodels) (2018.5)
Requirement not upgraded as not directly required: numpy>=1.9.0 in /usr/local/lib/python3.7/site-packages (from pandas->statsmodels) (1.14.5)
Requirement not upgraded as not directly required: six in /usr/local/lib/python3.7/site-packages (from patsy->statsmodels) (1.11.0)
Installing collected packages: statsmodels
Successfully installed statsmodels-0.9.0
However, when I run a program (that someone gave me) that is using it, I get this:
Traceback (most recent call last):
File "bin/rahul.py", line 5, in <module>
import statsmodels.api as sm
File "/usr/local/lib/python3.7/site-packages/statsmodels/api.py", line 7, in <module>
from .regression.recursive_ls import RecursiveLS
File "/usr/local/lib/python3.7/site-packages/statsmodels/regression/recursive_ls.py", line 16, in <module>
from statsmodels.tsa.statespace.mlemodel import (
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/mlemodel.py", line 18, in <module>
from .simulation_smoother import SimulationSmoother
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/simulation_smoother.py", line 10, in <module>
from .kalman_smoother import KalmanSmoother
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/kalman_smoother.py", line 11, in <module>
from statsmodels.tsa.statespace.representation import OptionWrapper
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/representation.py", line 10, in <module>
from .tools import (
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/tools.py", line 207, in <module>
set_mode(compatibility=None)
File "/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/tools.py", line 59, in set_mode
from . import (_representation, _kalman_filter, _kalman_smoother,
ImportError: cannot import name '_representation' from 'statsmodels.tsa.statespace' (/usr/local/lib/python3.7/site-packages/statsmodels/tsa/statespace/__init__.py)
bash-3.2$