如何解决ImportError: DLL load failed: The specified procedure could not be found

落花浮王杯 提交于 2020-03-15 17:49:27

机器环境

在windows10配置TensorFlow的环境,使用python3.7、Anaconda。安装的TensorFlow是2.1版本。conda在安装完成 各种包之后命令行执行 测试程序都ok,但是在Pycharm中执行就会报如下错误!
错误Log:

D:\Local\anaconda3\envs\tensorflow\lib\site-packages\numpy\__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "D:\Local\anaconda3\envs\tensorflow\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "D:\Local\anaconda3\envs\tensorflow\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
    from . import overrides
  File "D:\Local\anaconda3\envs\tensorflow\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

解决方法

Windows的环境变量,添加3个路径,anaconda的安装路径。分别为:D:\Local\anaconda3,D:\Local\anaconda3\Scripts,D:\Local\anaconda3\Library\bin;

之后记得重新启动Pycharm,再次执行python脚本就ok了。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!