windows 下import torch 报错:ImportError: DLL load failed: 操作系统无法运行 %1。

Windows 下通过 conda 安装 pytorch 后 ,

import torch 报错 :

**   from torch._C import ***

ImportError: DLL load failed: 操作系统无法运行 %1。

解决办法:

  1. Download win-64/intel-openmp-2018.0.0-8.tar.bz2
  2. 上面的链接有时候下载比较慢,这里有网盘版本:https://download.csdn.net/download/xrinosvip/10580839
  3. unzip the downloaded file, and put the dll files in Library\bin into Python dll path: C:\Users\username\AppData\Local\Programs\Python\Python36\DLLs(you can locate python path using where python command)
  4. 例如:我的python 的安装路径:D:\ProgramData\Anaconda3,就把 两个 .dell 文件复制到:D:\ProgramData\Anaconda3\Library\bin(该文件夹下有同名的文件,最好先备份原来的 两个 .dell 文件)
  5. check if Python path in environment variables配置python的环境变量,我的电脑——属性——高级系统设置——高级——环境变量——双击进入path——添加,将第第三步的DLLS文件夹路径添加到环境变量中即可。
  6. 重启python,这一步很关键

若上面的方法解决不了,请参考我的另一篇博客:

https://blog.csdn.net/xrinosvip/article/details/81383399

Reference:

https://blog.csdn.net/deeplearningfeng/article/details/80736151

猜你喜欢

转载自blog.csdn.net/xrinosvip/article/details/81380604