conda安装pytorch的镜像源问题
2023-06-13 09:12:28 时间
在安装pytorch的时候因为源的问题折腾了非常久,在这记录以下。
问题
报错:
(video_env) D:\profession\code\model\SAAT-master>conda install pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly -c pytorch
Collecting package metadata (current_repodata.json): failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "D:\software\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 378, in _load
raise UnavailableInvalidChannel(self.url_w_repodata_fn, 404)
conda.exceptions.UnavailableInvalidChannel: The channel is not accessible or is invalid.
channel name: anaconda/pkgs/free
channel url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
error code: 404
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\software\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 371, in _load
raw_repodata_str = fetch_repodata_remote_request(
File "D:\software\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 808, in fetch_repodata_remote_request
raise Response304ContentUnchanged()
conda.core.subdir_data.Response304ContentUnchanged
During handling of the above exception, another exception occurred:
我大概就截图这么多吧,大概就这种类型的错误。
网上的办法
设置源:
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://repo.continuum.io/pkgs/free/
conda config --add channels https://repo.continuum.io/pkgs/main/
conda config --set show_channel_urls yes
最终解决办法
- 运行以下命令
conda clean -i
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- 执行安装命令
conda install pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly
注意:在执行的安装pytorch的命令的最后,一定要将 -c pytorch
删除掉
大概就这样。
相关文章
- pycharm安装不上包_pycharm调用不了已安装的包
- Python+Appium从安装到第一个小练习(保姆级别教程)
- jmeter安装及使用
- 安装conda和jupyter notebook
- Linux宝塔面板安装
- 【Ps2023下载】Mac版 Photoshop 2023 v24.0软件下载及安装教程
- Linux-Manjaro18.0.4 安装sogou输入法
- Block-1.5的编译和安装
- Conda安装不上pytorch以及电脑有CUDA测试结果却为FALSE
- 电磁仿真软件Ansys Electronics2022中文版,Ansys软件安装下载
- MongoDB入门到进阶笔记:01-Linux 单机版MongoDB安装
- USB安装Linux:一步一步实现计算机改变(从usb安装linux)
- 安装MySQL卡住:解决之道(安装mysql卡死)
- 解决Oracle安装时乱码问题(oracle安装时乱码)
- windows 下为Python安装redis详解编程语言
- Oracle安装管理:安全保护口令(oracle安装管理口令)
- 构建Redis客户端连接安装好的Redis服务(安装好redis怎么连接)