当前位置:网站首页>pytorch安装错误
pytorch安装错误
2022-08-03 09:19:00 【南吕十七】
纠正
安装pytorch
首先要创建虚拟环境:conda activate pytorch
从(base)->(pytorch)

结果出现错误
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/cloud/conda-forge/noarch/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))
因为正常安装pytorch是后面要加-c pytorch 的,但是我这里本来是想用清华源的
这里输入
conda config --set show_channel_urls yes让conda告诉我们下载的时候用的哪个镜像源
之后输入conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch开始安装,结果出现以错误

原因可能是:清华源有误,找到C:\Users\Administrator文件下的.condarc文件将里面的内容改为:
channels:
- defaults
show_channel_urls: true
default_channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: http://mirr
输入:conda config --add channels conda-forge
之后再在Anaconda prompt中输入conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch 就安装成功了,
判断是否安装成功
输入pip list 出现

或者输入python,之后输入import torch 不报错即表示安装成功
边栏推荐
- RSTP(端口角色+端口状态+工作机制)|||| 交换机接口分析
- 别人都不知道的“好用”网站,让你的效率飞快
- 索引(三)
- Unity编辑器扩展批量修改图片名称
- 判断根节点是否等于子节点之和
- When deleting a folder, the error "Error ox80070091: The directory is not empty" is reported. How to solve it?
- Index (3)
- Validate floating point input
- Chrome F12 keep before request information network
- 【LeetCode】622.设计循环队列
猜你喜欢
随机推荐
Chrome F12 keep before request information network
梯度消失和梯度爆炸
AD环境搭建
Exception: Dataset not found.解决办法
固件工程师到底是干什么?
cnpm安装步骤
CSP-S2019 Day2
【LeetCode】101.对称二叉树
好用的插件
线程介绍与使用
013-二叉树
【快手面试】Word2vect生成的向量,为什么可以计算相似度,相似度有什么意义?
STP生成树(端口状态+端口角色+收敛机制 )|||| STP优化技术( uplinkfast技术+Portfast技术+backbonefast技术 )详解
cmd(命令行)操作或连接mysql数据库,以及创建数据库与表
Flink Yarn Per Job - Submit application
Automated test browser driver download version
QImage的指针问题
文章列表的显示 以及创建文章 还有文章详情的基本
批量将PNG格式转化为JPG格式
【LeetCode】226. Flip the binary tree









