【问题标题】:Error from sklearn.neural_network import MLPRegressor来自 sklearn.neural_network 导入 MLPRegressor 的错误
【发布时间】:2019-12-10 15:44:00
【问题描述】:

我正在 Python 上构建神经网络代码。当我在笔记本电脑上执行代码时,一切都很顺利。当我将它发送给我的朋友时:它给出了图片中显示的错误。我尝试卸载 python 并重新安装它,卸载 pip,卸载 sklearn,然后安装它们。没有任何效果。

ImportError:DLL 加载失败。

有人可以帮忙吗?

完整的错误如下:

RESTART: C:\D-drive\AUB 2019-2020\Fall\CHEN499\Mohamad Ibrahim\499 research\neural networks\example 6\NN1.py 
Traceback (most recent call last):
  File "C:\D-drive\AUB 2019-2020\Fall\CHEN499\Mohamad Ibrahim\499 research\neural networks\example 6\NN1.py", line 1, in <module>
    from sklearn.neural_network import MLPRegressor
  File "C:\Users\jz08\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\__init__.py", line 75, in <module>
    from .utils._show_versions import show_versions
  File "C:\Users\jz08\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed: The specified module could not be found.

谢谢。

【问题讨论】:

  • 我也试过卸载 scipy 和 numpy 然后从命令提示符安装它们;但是错误仍然存​​在...
  • 亲爱的 Makis,我尝试了 stackoverflow 上建议的所有内容..

标签: python scikit-learn neural-network sklearn-pandas


【解决方案1】:

我遇到了同样的问题,并且只能通过返回 scikit-learn (0.20.2) 的先前版本之一来解决它尝试降级 sklearn。 我知道这是一个次优的解决方案,但希望你能够在你目前正在工作的任何项目中取得进展。希望这会有所帮助!

【讨论】:

  • 查看您的具体错误后发现:github.com/scikit-learn/scikit-learn/issues/15786 某些版本的 sklearn 和某些版本的 Visual Studio 之间似乎存在不兼容问题。这家伙通过安装 Visual Studio 2019 解决了这个问题。
  • Mano 提供的解决方案奏效了!非常感谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-09
  • 1970-01-01
  • 2018-08-17
  • 2018-06-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多