Torch is installed in the environment, and an error is reported when importing: ImportError: DLL load failed: The specified module cannot be found.

Torch is installed in the environment, but still appears - ImportError: DLL load failed: The specified module cannot be found.


ImportError: DLL load failed: 找不到指定的模块。)
Traceback (most recent call last): File “E:/mycode/SmartToolLibary_v1.0/test.py”, line 1, in import torch File “D:\Program Files\anaconda3\lib\site-packages\torch_ init_.py”, line 81, in ctypes.CDLL(dll) File "D:\Program …

ImportError: DLL load failed: The specified module could not be found .


the reason

  1. Maybe you have installed more than two versions. For example, 1.3.1 and 1.5.1
    solutions: update to one

    $ conda update pytorch
    
    

    Or uninstall one:conda uninstall XXX


  1. The pytorch development team believes that there may also be a torch folder at present, which is mistakenly regarded as the folder where the torch library is located.
    Solution: the current folder cannot be called torch

Guess you like

Origin blog.csdn.net/beauthy/article/details/106824587