ModuleNotFoundError: No module named ‘sklearn‘ 解決辦法


問題:No module named ‘sklearn’

解決辦法:

如果 pip install sklearn安裝失敗,換成國內的源就好了,比如:

pip install sklearn -i https://pypi.tuna.tsinghua.edu.cn/simple

 

安裝成功!
在這里插入圖片描述

國內的源:

  • 清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
  • 阿里雲 http://mirrors.aliyun.com/pypi/simple/
  • 中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
  • 豆瓣(douban) http://pypi.douban.com/simple/
  • 中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/

其中清華的鏡像源5分鍾同步官網一次,建議使用。

用法:

  • pip install XXX -i http://pypi.douban.com/simple/ --trusted -host pypi.douban.com

    即在原來pip install XXX命令后添加了 -i http://pypi.douban.com/simple/ --trusted -host pypi.douban.com 后面的鏈接是在國內的豆瓣鏡像,這樣就會臨時使用豆瓣的pypi鏡像去安裝庫了

    如果所使用的鏡像源是未采用https加密協議的鏡像網站,則會產生"網站不受信任的問題",此時需要指定 –trusted-host參數手動授權信任。

  • pip install xxx -i https://pypi.tuna.tsinghua.edu.cn/simple
    這樣就會臨時使用清華大學的pypi鏡像去安裝庫了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM