安装pytorch环境时Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
时间: 2023-12-11 15:33:22 浏览: 165
当安装pytorch环境时,如果出现"Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve."的错误提示,可以尝试以下方法解决:
1.更新conda:在Anaconda Prompt中输入以下命令,更新conda到最新版本。
```shell
conda update conda
```
2.清除缓存:在Anaconda Prompt中输入以下命令,清除conda的缓存。
```shell
conda clean --all
```
3.更改conda源:在Anaconda Prompt中输入以下命令,更改conda的源为清华源。
```shell
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 --set show_channel_urls yes
```
4.重新安装pytorch:在Anaconda Prompt中切换到要安装pytorch的环境,再输入以下命令,重新安装pytorch。
```shell
conda install pytorch torchvision torchaudio cpuonly -c pytorch
```