Win10下pip安装PyTorch后出现“from torch._C import * ImportError: DLL load failed: 找不到指定的模块”错误的解决办法

亲测可行(之前找到的方法:添加PATH,对我不管用。例外在此之前装过0.4.1版本的开域导入, 后来更新成0.4.0 就报错了)

博主今天安装遇到了import问题记录一下方便以后参考。

Win10下pip安装PyTorch后出现“from torch._C import * ImportError: DLL load failed: 找不到指定的模块”错误的解决办法_第1张图片

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\__init__.py", line 78, in 
    from torch._C import *
ImportError: DLL load failed: 找不到指定的模块。

I had this similar problem in windows 10...

Solution:

  • Download win-64/intel-openmp-2018.0.0-8.tar.bz2 from https://anaconda.org/anaconda/intel-openmp/files

  • Extract it and put the dll files in Library\bin into 
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin

  • Win10下pip安装PyTorch后出现“from torch._C import * ImportError: DLL load failed: 找不到指定的模块”错误的解决办法_第2张图片

  • Make sure your cuda directory is added to your %PATH% environment variable

你可能感兴趣的:(程序人生,PyTorch,pip)