conda中安装pytorch报错及解决方案:ImportError: DLL load failed: 找不到指定的程序

2021/6/19 20:26:57

本文主要是介绍conda中安装pytorch报错及解决方案:ImportError: DLL load failed: 找不到指定的程序,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

win10
python 3.6

import torch
报错类似于
import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "d:\Anaconda3\envs\torch\lib\site-packages\torch\__init__.py", line 84, in <module>
    from torch._C import *
ImportError: DLL load failed: 找不到指定的模块。

解决方案

零、在pycharm-file-settings-python interpreters中找到项目环境位置

并且找出torch版本 此项目为1.0.1
https://download.pytorch.org/whl/torch_stable.html
我下载的文件名是torch-1.0.1-cp36-cp36m-win_amd64.whl
用ctrl+f查询所需文件,双击下载即可
在这里插入图片描述

win+R

conda info --envs

在这里插入图片描述

复制环境名称 SimplE-master

conda activate SimplE-master

在这里插入图片描述

pip install torch-1.0.1-cp36-cp36m-win_amd64.whl

在这里插入图片描述
显示已下载,先卸载,安装新下载的文件

pip uninstall torch

输入 y,继续卸载
在这里插入图片描述
重新输入

pip install torch-1.0.1-cp36-cp36m-win_amd64.whl

在这里插入图片描述
回到pycharm,等一会,运行,不报这个错了

又有新的错误了,哭哭~~

感谢
https://blog.csdn.net/yuxy411/article/details/113280415



这篇关于conda中安装pytorch报错及解决方案:ImportError: DLL load failed: 找不到指定的程序的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程