机器环境
在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了。
来源:oschina
链接:https://my.oschina.net/xiaopei/blog/3195350