当前位置:   article > 正文

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

collecting package metadata (current_repodata.json): done solving environmen

安装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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

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

conda config --remove-key channels
  • 1

再说说,踩过的坑:
目标是在服务器上安装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
  • 2
  • 3
  • 4
  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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  1. 更新包的版本后依旧不成功
conda update conda
conda update -all
  • 1
  • 2
  1. 执行下面命令依旧不成功
conda config --add channels conda-forge
conda config --set channel_priority flexible
  • 1
  • 2
  1. 改用pip安装,依旧不成功
 pip3 install torch torchvision torchaudio
  • 1
  1. 更新pip不成功
pip install --upgrade pip
  • 1
  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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

终于装上了!!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/91760
推荐阅读
相关标签
  

闽ICP备14008679号