OSError: [WinError 126] 找不到指定的模块。 Error loading “D:\ProgramData\Anaconda3\lib\site-packages\torch\li

今天跑代码的时候,pytorch报错,说找不到指定模块,之前重装了电脑,好多东西都没了。看着这个报错,觉得心好累。

OSError: [WinError 126] 找不到指定的模块。 Error loading "D:\ProgramData\Anaconda3\lib\site-packages\torch\lib\asmjit.dll" or one of its dependencies.

仔细看看报错信息,发现开头就告诉我说是因为没有安装c++,才报错的

Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
                 It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe
Traceback (most recent call last):
  File "D:/ProgramData/PycharmProjects/T2/LSTM-CRF-main/LSTM_CRF.py", line 1, in 
    import torch
  File "D:\ProgramData\Anaconda3\lib\site-packages\torch\__init__.py", line 137, in 
    raise err
OSError: [WinError 126] 找不到指定的模块。 Error loading "D:\ProgramData\Anaconda3\lib\site-packages\torch\lib\asmjit.dll" or one of its dependencies.

OSError: [WinError 126] 找不到指定的模块。 Error loading “D:\ProgramData\Anaconda3\lib\site-packages\torch\li_第1张图片按照报错信息给的地址下载安装,问题就解决了。

Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
               
 It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe

 下载地址:https://aka.ms/vs/16/release/vc_redist.x64.exe

你可能感兴趣的:(pytorch)