Conda install some-package hangs with (Solving environment: failed)(Conda install some-package 挂起(解决环境:失败))
问题描述
我尝试了多种方法,但无法 conda 安装软件包(在我的例子中是 geopandas).我尝试了 geopandas 安装指南,但得到了求解器永远运行的输出.在创建新环境后,我尝试不创建环境,使用 defaults 频道并使用 conda-forge 频道.没有任何效果.
I have tried multiple ways but can't conda install packages (in my case, geopandas). I tried geopandas install guide, but get output that the solver runs forever. I tried without creating an environment, after creating a new environment, using defaults channel and using conda-forge channel. None worked.
$ conda create -n top
$ conda activate top
$ conda config --env --add channels conda-forge
$ conda config --env --set channel_priority strict
$ conda install python=3 geopandas
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:
我不想使用 pip install,因为我更喜欢使用 conda install.我还尝试按照 this answer 使用 Anaconda Navigator 进行安装,但进度条保持不变运行说解决包规范.
I don't want to use pip install because it is preferred to use conda install.
Also I tried installing using Anaconda Navigator following this answer, but the progress bar keeps running saying solving package specifications.
推荐答案
支持在创建时指定约束
迭代安装包是 Conda 的真正瓶颈.如果您事先知道 env 需要某些包,请在创建时指定它们:
Favor Specifying Constraints at Creation
Iteratively installing packages is a real choking point for Conda. If you know up front that the env will require certain packages, then specify them at creation:
conda create -n top -c conda-forge -c defaults python=3 geopandas
这对我来说在几秒钟内就解决了.如果你有很多包,那么 使用 YAML.
This solves in seconds for me. If you have many packages, then use a YAML.
有时临时安装是不可避免的.对于棘手的解决方案(或一般情况下),尝试使用 mamba, conda 的已编译(快速!)替代品.曼巴将在康达挣扎的地方大放异彩.
Sometimes ad hoc installations are unavoidable. For tough solves (or just generally), try using mamba, a compiled (fast!) drop-in replacement for conda. Mamba will shine where Conda struggles.
# install mamba
conda install -n base conda-forge::mamba
# use mamba
mamba install -n top geopandas
这篇关于Conda install some-package 挂起(解决环境:失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Conda install some-package 挂起(解决环境:失败)
基础教程推荐
- 求两个直方图的卷积 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 包装空间模型 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
