首页 前端知识 解决:Collecting package metadata (current_repodata.json)/ Solving environment

解决:Collecting package metadata (current_repodata.json)/ Solving environment

2024-04-20 17:04:38 前端知识 前端哥 511 969 我要收藏

安装Pytorch时报错:

Collecting package metadata (current_repodata.json): - WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): - WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0

先说最后成功解决的办法:
执行下面语句后,装pytorch, torchvision, torchaudio都成功安装了,一点不报错:

conda config --remove-key channels

再说说,踩过的坑:
目标是在服务器上安装pytorch, 先是创建了虚拟环境,安装cuda版本的pytorch时一直报错。尝试用下面的办法解决,都没有成功

最初直接安装,报错
(AE-base) sh-5.0$ conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): | WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
  1. 尝试指定各个包的版本,失败
(AE-base) sh-5.0$ conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): - WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): - WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
  1. 尝试删除**.condarc**, 依旧不能成功安装
查看.condarc的位置,然后删除
(AE-base) sh-5.0$ conda config --show-sources
==> /home/XX/.condarc <==
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
  - conda-forge

==> cmd_line <==
debug: False
json: False
  1. 更新包的版本后依旧不成功
conda update conda
conda update -all
  1. 执行下面命令依旧不成功
conda config --add channels conda-forge
conda config --set channel_priority flexible
  1. 改用pip安装,依旧不成功
 pip3 install torch torchvision torchaudio
  1. 更新pip不成功
pip install --upgrade pip
  1. 添加http镜像,不成功
(AE-base) sh-5.0$ conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
(AE-base) sh-5.0$ conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
(AE-base) sh-5.0$ conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
(AE-base) sh-5.0$ conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
(AE-base) sh-5.0$ conda config --set show_channel_urls yes
(AE-base) sh-5.0$ conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): \ WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
  1. 成功
(AE-base) sh-5.0$ conda config --remove-key channels
(AE-base) sh-5.0$ conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/shipc/miniconda3/envs/AE-base

  added / updated specs:
    - pytorch
    - pytorch-cuda=11.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2021.5.30          |   py36h06a4308_0         139 KB  defaults
    cuda-cudart-11.7.99        |                0         194 KB  nvidia

终于装上了!!!

转载请注明出处或者链接地址:https://www.qianduange.cn//article/5510.html
标签
评论
发布的文章

JQuery中的load()、$

2024-05-10 08:05:15

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!