ModuleNotFoundError: No module named ‘numpy.testing.nosetester’

This is happening due to a version incompatibility between numpy and scipy. numpy in its latest versions have deprecated numpy.testing.nosetester.

Replicating the issue

pip install numpy==1.18 # > 1.18
pip install scipy<=0.19.0 # <= 0.19 

and

from sklearn.tree import DecisionTreeClassifier as DTC

Triggers the error.

Fixing the error

Upgrade your scipy to a higher version.

pip install numpy==1.18
pip install scipy==1.1.0
pip install scikit-learn==0.21.3

But not limited to this. By upgrading the above libraries to the latest stable, you should be able to get rid of this error.

Leave a Comment