You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ImportError: DLL加载失败:找不到指定模块问题求助

解决PyTorch 1.3.1 + Python 3.7.8的ImportError: DLL load failed问题

以下是经过验证的修复步骤:

  • 安装对应VC++运行库:PyTorch 1.3.1依赖Visual C++ Redistributable for Visual Studio 2019(x64版本),安装完成后重启系统。
  • 重新安装PyTorch(确保完整性):先卸载现有版本,再用官方指定命令重新安装,避免包损坏或依赖缺失:
    pip uninstall torch -y
    # CPU版本安装命令
    pip install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
    # GPU版本(以CUDA 10.1为例)安装命令
    pip install torch==1.3.1+cu101 torchvision==0.4.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
    
  • 排查依赖冲突:部分高版本numpy会与PyTorch 1.3.1不兼容,可降级numpy到兼容版本:
    pip install numpy==1.19.5
    
  • 修复系统PATH配置:将PyTorch安装目录下的Lib\site-packages\torch\lib路径添加到系统环境变量PATH中,重启后再运行程序。

内容的提问来源于stack exchange,提问作者BHAVADHARINI RATHINASABAPATHY

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 23:17:05