from torch._C import * ImportError: DLL load failed

created at 06-27-2021 views: 2

Problem overview

This is the problem that the author encountered when installing PyTorch1.10 on the windows10 platform.

The author uses conda to install PyTorch1.10 gpu version instruction: conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

When the installation is complete, an error is reported: from torch._C import * ImportError: DLL load failed: The specified program cannot be found.

C:\Users\xiaos> python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 11:57:41) [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 "<stdin>", line 1, in <module>
  File "C:\YSSFiles\APP\Ruanjian\Miniconda3\envs\TORCH_CPU\lib\site-packages\torch\__init__.py", line 79, in <module>
    from torch._C import *
ImportError: DLL load failed: program could not be found.
>>>

solution

Update python==3.6.7 or python==3.7.0 (I updated to python==3.6.7)

conda install python==3.6.7

It should be noted that if you installed it with python==3.6.0 before, if you upgrade to python==3.7.0, then PyTorch needs to be reinstalled.

Please log in to leave a comment.