問題描述:
利用 conda 安裝某包
conda install -c "nvidia/label/cuda-11.8.0" cuda-nvcc
時發現報錯:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages. failed UnsatisfiableError: The following specifications were found to be incompatible with each other:Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible
具體來說:
Found conflicts! Looking for incompatible packages.
解決方案:
- 博客【conda安裝軟件報兼容性問題的解決 Found conflicts! Looking for incompatible packages.failed.UnsatisfiableError】認為是鏡像的問題,在報錯的服務器添加國內鏡像或者升級一些特定庫。
- 以上方法均對本人無效,經過排查發現,是因為之前刪除 conda 環境時未刪除干凈,導致新建的該環境里依舊識別到原來同名環境里的庫。采用
pip list
發現了很多尚未安裝的庫。解決方法是首先退出當前激活的虛擬環境,使用conda deactivate
命令。然后,使用conda remove -n your_env_name --all
命令來刪除指定的虛擬環境。請將your_env_name
替換為你要刪除的虛擬環境的名稱。--all
一定不能省略,否則卸載之后可能還會存在原環境的文件夾,導致用此名稱再次新建環境時發生沖突。