ModuleNotFoundError: No module named 'sklearn'

前端 未结 10 1355
天涯浪人
天涯浪人 2020-12-29 17:37

I want to import sklearn but there is no module apparently:

ModuleNotFoundError: No module named \'sklearn\'

I am using Anaconda and

10条回答
  •  鱼传尺愫
    2020-12-29 18:20

    I've tried a lot of things but finally, including uninstall with the automated tools. So, I've uninstalled manually scikit-learn.

    sudo rm -R /home/ubuntu/.local/lib/python3.6/site-packages/sklearn
    sudo rm -R /home/ubuntu/.local/lib/python3.6/site-packages/scikit_learn-0.20.0-py3.6.egg-info
    

    And re-install using pip

    sudo pip3.6 install -U scikit-learn
    

    Hope that can help someone else!

提交回复
热议问题