尝试在Python 3.8上安装Sklearn时出现错误

我正在尝试使用以下命令在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。我已经卸载了该软件包,然后重新安装。

MYLIFEA 回答:尝试在Python 3.8上安装Sklearn时出现错误

刚发现这个GitHub issue时说了以下话(16天前):

  

NumPy尚未正式支持Python 3.8。我们强烈建议您暂时坚持使用python 3.7,直到在PyPI numpy页面的“编程语言”部分中看到3.8的名称(大约数周),或者直到可以使用Python 3.8的Anaconda发行版(可能数月)为止

所以看起来它可能是基础依赖项,但尚未与3.8一起使用。实际上,上周我在另一个软件包中遇到了类似的问题。如果您得到3.7.5 install,可能会很幸运。确保使用正确的平台(32位为x86,64位为x64),并确保选中此框以将其添加到路径中。

我猜你在Windows上,是吗?如果是这样,则在安装后打开Powershell并输入gcm pythongcm pip以确保它们已从3.7安装中撤出。如果没有,则必须在系统环境变量中编辑PATH,然后将新的Python37目录移到PATH中的Python38之前。

希望能解决这个问题!

,

尝试运行pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn。它对我有用。

本文链接:https://www.f2er.com/3141571.html

大家都在问