You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since release 1.3.0 of Scipy aliases from scipy.misc (comb, factorial, factorial2, factorialk, logsumexp, pade, info, source, who) which have been deprecated since v1.0.0 are removed.
Resulting in incompatibility between statsmodels and scipy.
Code Sample, a copy-pastable example if possible
In a python 3 env
pip install statsmodels
pip install scipy
Then in a python shell
importstatsmodels.stats.apiassm# ImportError: cannot import name 'comb' from 'scipy.misc'
Expected Output
statsmodels is working with scipy 1.2.1 but it will be better than statsmodels stay compatible with last scipy release.
statsmodels 0.9 is not compatible with SciPy 1.3.0. The current master branch is compatible and the next release will be compatible. The options are to downgrade SciPy, install in a virtual- or conda-env with SciPy 1.2, or to install from master using the code provided above.
Reacted by João Francisco Martins, pottieral, Ryan Maxwell Wenzel, Maxime DE BOIS, George Ho and Aadarsh Singh
If it can help anybody, here's a shell script workaround in the meanwhile.
#!/usr/bin/env bash# Attention: this patches scipy => when statmodels is fixed, you need to# re-install scipy in order to "unpatch" it
initPy=$(pip show scipy | grep 'Location'| awk -F ': ''{print $2"/scipy/misc/__init__.py"}')
cat <<EOF >>$initPy# https://github.com/statsmodels/statsmodels/issues/5759 workaroundfrom ..special import factorial, logsumexp, comb__all__ += ['factorial', 'logsumexp', 'comb']EOF
hi, update till the current moment for PyCharm.
1.Delete modules Scipi and statmodels (any version)
2. Install scipi last vestion
3. Install statmodels module
and it works!
Activity
mfschmidt commentedon May 20, 2019
According to bashtage at #5747 you can install from the master branch and everything works. I tried this as follows:
It seemed to resolve the issue for me, so far.
bashtage commentedon May 20, 2019
statsmodels 0.9 is not compatible with SciPy 1.3.0. The current master branch is compatible and the next release will be compatible. The options are to downgrade SciPy, install in a virtual- or conda-env with SciPy 1.2, or to install from master using the code provided above.
[-]statsmodels x scipy 1.3.0 incompatibility[/-][+]FAQ: Statsmodels 0.9/Scipy 1.3.0 incompatibility[/+]stonebig commentedon May 20, 2019
when is the next [pypi] release ? at least a statsmodels-10.0.0dev1 would be nice to have on pypi
Ping scipy version due to statsmodels/statsmodels#5759
ptornich commentedon May 22, 2019
Is there any predictions for a pypi release?
bashtage commentedon May 22, 2019
force scipy<1.3.*
Disable tests to keep build from timing out
tiffanyhsu001 commentedon Jun 5, 2019
after installing from master:
pip install --upgrade git+https://github.com/statsmodels/statsmodels
i get this new (similar) error:
ImportError: cannot import name 'factorial' from 'statsmodels.compat.scipy'
i have scipy 1.3.0
someone help?
bashtage commentedon Jun 5, 2019
You need to make sure you have removed any previous version
Run this command a few times until you get a message that it isn't installed.
This is not a bug in master so something is wrong with the one installed.
tiffanyhsu001 commentedon Jun 5, 2019
@bashtage fixed it thank you!
force scipy<1.3.* and test for py37
mhooreman commentedon Jun 14, 2019
Hello,
If it can help anybody, here's a shell script workaround in the meanwhile.
Best regards.
KonstantinDoronin commentedon Jun 17, 2019
hi, update till the current moment for PyCharm.
1.Delete modules Scipi and statmodels (any version)
2. Install scipi last vestion
3. Install statmodels module
and it works!
astrojuanlu commentedon Jun 17, 2019
If you want to keep stable statsmodels:
(don't do this if you installed SciPy with conda)
If you want to try the upcoming statsmodels version while keeping the latest scipy:
update requirements to avoid statsmodels-scipy clash
clemenspeters commentedon Jun 18, 2019
Thanks @bashtage
pip install statsmodels==0.10.0rc2 --preRestarting the kernel of the jupyter notebook
fixed it for me.
You can check your versions with
pip listbashtage commentedon Jun 24, 2019
0.10.0 has been released. Only sdist is on PyPI. Wheels should follow in the next day or so.
bhattaraiprabhat commentedon Jul 5, 2019
Thanks @bashtage,@ clemenspeters:
Finally, 1. pip install statsmodels==0.10.0rc2 --pre
Solved the issue!