当前位置:网站首页>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 不报错即表示安装成功
边栏推荐
猜你喜欢
随机推荐
dflow入门3——dpdispatcher插件
固件工程师到底是干什么?
For heavy two-dimensional arrays in PHP
多媒体数据处理实验1:算术编码
Cartesi 2022 年 7 月回顾
selenium IDE的3种下载安装方式
【字节面试】word2vector输出多少个类别
Flink Yarn Per Job - 启动AM
兔起鹘落全端涵盖,Go lang1.18入门精炼教程,由白丁入鸿儒,全平台(Sublime 4)Go lang开发环境搭建EP00
【LeetCode】622.设计循环队列
【LeetCode】zj面试-把字符串转换成整数
MySQL-存储过程-函数-
Rabbit and Falcon are all covered, Go lang1.18 introductory and refined tutorial, from Bai Ding to Hongru, the whole platform (Sublime 4) Go lang development environment to build EP00
STP生成树选举结果查看及验证
SAP Analytics Cloud 和 SAP Cloud for Customer 两款 SaaS 软件的集成
AD环境搭建
qt使用mysql数据库(自学笔记)
110道 MySQL面试题及答案 (持续更新)
scala减少,reduceLeft reduceRight,折叠,foldLeft foldRight
mysql数据库配置性能调优








