ImportError: cannot import name 'ConstantInputWarning' from 'scipy.stats'

94 views Asked by At

Error due to scikit-kbio:

ImportError: cannot import name 'ConstantInputWarning' from 'scipy.stats' (/home/smith/miniconda3/lib/python3.8/site-packages/scipy/stats/__init__.py)

This is likely related to recent installations (like numba) which might have modified versions of numpy and scipy, as previously the problem didn't occur.

Versions:
python : 3.8
scipy : 1.8.1
numpy : 1.22.4
skbio : 0.5.9

Related:
Error: cannot import name 'SpearmanRConstantInputWarning' from 'scipy.stats'
Cannot import name 'ConstantInputWarning' from 'scipy.stats' #4

1

There are 1 answers

0
Roger V. On

The currently adopted solution was to revert to an earlier revision of conda, as described in the answer to Conda install screwed up my environment. Can I undo it?

The functioning combination of versions in my case is:
python : 3.8.17
scipy : 1.10.0
numpy : 1.24.4
skbio : 0.5.9