Solve two errors about sklearn

1. Ask questions

Two errors occurred in succession when running the code just now:
①ModuleNotFoundError: No module named 'sklearn'

②ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'

 2. Problem Analysis

The 'sklearn' in the first error report is the abbreviation of scikit-learn (I thought it was the full name at first..)

The second error is a version issue, which is caused by some methods in the scikit-learn library being removed or updated. We can solve the problem by changing the version of scikit-learn library. (Need to downgrade the version of scikit-learn to 0.19.X or below)

3. Problem solving

pip install scikit-learn

pip install scikit-learn==0.19.2

problem solved! 

reference:

ModuleNotFoundError: No module named ´sklearn.utils.linear_assignment__anshiquanshu's Blog-CSDN Blog

ModuleNotFoundError: No module named sklearn_Today is another hopeful day's blog-CSDN Blog

Guess you like

Origin blog.csdn.net/m0_64007201/article/details/127884880