使用Anaconda安装xarray-spatial遇UnsatisfiableError但无冲突详情
解决conda安装xarray-spatial时无详细信息的UnsatisfiableError问题
问题重现
执行的安装命令:
(geo_env) C:\Users\Alex>conda install -c conda-forge xarray-spatial
错误输出:
(geo_env) C:\Users\Alex>conda install -c conda-forge xarray-spatial 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. This can take several minutes. Press CTRL-C to abort. failed UnsatisfiableError: The following specifications were found to be incompatible with each other: Output in format: Requested package -> Available versions Note that strict channel priority may have removed packages required for satisfiability.
解决方法
调整通道优先级
错误提示严格的通道优先级可能过滤掉必要包,先查看当前通道设置:conda config --show channels若
channel_priority为strict,改为flexible:conda config --set channel_priority flexible之后重新执行安装命令。
获取详细冲突信息
使用conda solve生成具体冲突报告,定位不兼容包:conda activate geo_env conda solve --dry-run -c conda-forge xarray-spatial命令会输出包版本冲突的细节,明确问题根源。
新建干净环境安装
现有环境依赖复杂时,直接创建新环境安装:conda create -n new_geo_env -c conda-forge xarray-spatial安装完成后激活新环境:
conda activate new_geo_env使用mamba替代conda
mamba是conda的高性能替代,求解速度更快、冲突信息更清晰。先在base环境安装mamba:conda install -n base -c conda-forge mamba再在geo_env中用mamba安装:
conda activate geo_env mamba install -c conda-forge xarray-spatial
内容的提问来源于stack exchange,提问作者Alex Shute
相关产品推荐
相关产品推荐

