Article directory
1. Wrong installation process
Currently in the conda virtual environment, install the sklearn module through the pip command
pip install sklearn
Then enter the python window and enter the following code
import sklearn
Start reporting an error: ModuleNotFoundError: No module named 'sklearn'
Two, the solution
View the information about installing the sklearn module with the following command
python -m pip show sklearn
As can be seen from the output results, the package is installed out of date, so we need to reinstall
2.1. Uninstall the installed package
pip uninstall sklearn
2.2. Install new packages
python -m pip install scikit-learn
After the installation is complete, enter the python window and enter
import sklearn
No error is reported, as shown in the figure below, it means that the installation is successful and can be successfully imported