簡體   English   中英

嘗試在 Python 3.8 上安裝 Sklearn 時出現錯誤

[英]Trying to Install Sklearn on Python 3.8 Gives an Error

我正在嘗試使用以下命令在 Windows 10 上的 Python 3.8 上安裝 sklearn(scikit-learn):

pip install sklearn

我也用過:

pip3 install sklearn

pip install scikit-learn 

pip install -U scikit-learn 

也:

pip install --only-binary :all: sklearn

我也嘗試過升級 pip/setuptools。

有很長的錯誤塊; 其中,似乎相關的部分提到了 Fortran:

 customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 customize IntelVisualFCompiler Could not locate executable ifort Could not locate executable ifl customize AbsoftFCompiler Could not locate executable f90 customize CompaqVisualFCompiler Could not locate executable DF customize IntelItaniumVisualFCompiler Could not locate executable efl customize Gnu95FCompiler Could not locate executable gfortran Could not locate executable f95 customize G95FCompiler Could not locate executable g95 customize IntelEM64VisualFCompiler customize IntelEM64TFCompiler Could not locate executable efort Could not locate executable efc customize PGroupFlangCompiler Could not locate executable flang don't know how to compile Fortran code on platform 'nt' NOT AVAILABLE

錯誤的另一部分:

numpy.distutils 中沒有名為“numpy.distutils._msvccompiler”的模塊;

我只是想知道這是否是因為 3.8 的新穎性? 有沒有人知道的解決方法?

它似乎圍繞 NumPy 展開。 我已經卸載了 package 並重新安裝了它。

剛剛發現這個GitHub 問題如下(16 天前):

NumPy 尚未正式支持 Python 3.8。 We strongly suggest you stick with python 3.7 for now, until you see a 3.8 designation in the "Programming Language" section of the PyPI numpy page (probably several weeks) or until an Anaconda release with Python 3.8 is available (probably several months)

所以看起來它可能是底層依賴項,只是還不能與 3.8 一起使用。 上周我實際上與另一個 package 有類似的問題。 如果您安裝了 3.7.5 ,您可能會很幸運。 確保您獲得了正確的平台(x86 用於 32 位,x64 用於 64 位)並確保選中該框以將其添加到您的路徑中。

我猜你在 Windows 是嗎? 如果是這樣,那么在安裝后打開 powershell 並輸入gcm pythongcm pip以確保它們是從 3.7 安裝中拉出的。 如果沒有,您必須在系統環境變量中編輯 PATH 並將新的 Python37 目錄移動到 PATH 中的 Python38 之前。

希望能解決問題!

嘗試運行pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn . 它對我有用。

上面給出的最后一個 pip 安裝對我有用。 謝謝

在命令提示符下試試這個:

py -m pip install -U scikit-learn

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM