刚安装完conda之后打算安装pytoch时:
PS C:\Users\25387> conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/win-64/current_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.
'https://conda.anaconda.org/pytorch/win-64'
参考Collecting package metadata (current_repodata.json): failed之后按以下操作将文件粘贴过去:
当在windows下面的Anaconda的命令行中运行 conda时,如果出现Collecting package metadata (current_repodata.json): failed
的错误提示,可以按照下面的方式来解决掉:把路径“Anaconda3/Library/bin ”下面的文件复制到路径“Anaconda3/DLLs”下:
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
PS C:\Users\25387> conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- cudatoolkit=10.2
Current channels:
- https://conda.anaconda.org/pytorch/win-64
- https://conda.anaconda.org/pytorch/noarch
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
根据博客conda安装环境报错:Solving environment: failed with initial frozen solve.的步骤:
PS C:\Users\25387> conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- cudatoolkit=10.2
Current channels:
- https://conda.anaconda.org/pytorch/win-64
- https://conda.anaconda.org/pytorch/noarch
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
解决方法链接: Anaconda使用conda连接网络出现错误
链接:解决办法
将用户目录下的:.condarc改为如下所示,改为如下:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
proxy_servers:
http: socks5://127.0.0.1:1080
ssl_verify: False
show_channel_urls: True
allow_other_channels: True
An HTTP error occurred when trying to retrieve this URL.
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
channels:
- conda-forge
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true