python中導入sklearn庫報錯解決

錯誤輸出(ImportError: DLL load failed: 找不到指定的模塊)

解決方法

步驟1:

  • 卸載原始版本庫文件,包括Numpy、Scipy、Scikit-learn 。
    打開DOS界面Anaconda Prompt界面執行以下命令:
    pip uninstall numpy
    pip uninstall scipy
    pip uninstall scikit-learn

步驟2:

  • 安裝新版本。因爲下載whl文件比較慢,可以使用清華大學鏡像進行在線下載和安裝,安裝順序如下:
    pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple

在這裏插入圖片描述

步驟3:

安裝完成後,程序可以正常執行。

發佈了11 篇原創文章 · 獲贊 4 · 訪問量 502
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章