当前位置:   article > 正文

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

oserror: [winerror 126] 找不到指定的模块

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

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

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

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

按照报错信息给的地址下载安装,问题就解决了。

  1. Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
  2. 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

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号