Python conda在“解决环境”时做了什么

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51753988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 19:55:28  来源:igfitidea点击:

What does conda do when "solving environment"

pythonanacondaupdatescondapackage-managers

提问by dkv

Whenever I run conda install/remove/update <package>, it tells me it's "Solving environment" for some time before telling me the list of things it's going to download/install/update. Presumably it's looking for dependencies for <package>, but why does it sometimes removepackages after doing this operation? For example, as I was trying to install Mayavi, it decided it needed to remove Anaconda Navigator.

每当我运行时conda install/remove/update <package>,它都会告诉我它是“解决环境”一段时间,然后告诉我它将要下载/安装/更新的内容列表。大概它正在寻找 的依赖项<package>,但为什么它有时会在执行此操作后删除包?例如,当我尝试安装 Mayavi 时,它决定需要删除 Anaconda Navigator。

Furthermore it does not provide an option to perform only a subset of the suggested operations. Is there a way to specify that I don't want a package removed?

此外,它不提供仅执行建议操作的子集的选项。有没有办法指定我不想删除包?

回答by zhaofeng-shu33

You can add --debugoption to the conda command and see the output from console(or terminal). For example, type conda update --debug numpy. From the output, we can see that the client requests repodata.jsonfrom channel list and do some computation locally in the Solving EnvironmentStep.

您可以--debug向 conda 命令添加选项并查看控制台(或终端)的输出。例如,键入conda update --debug numpy。从输出中,我们可以看到客户端repodata.json从通道列表中请求并在Solving EnvironmentStep本地进行一些计算。

回答by Katyjean57

As a side note on the "Solving Environment" step...
Lack of administrator privileges may affect whether or where you can install python packages.

作为“解决环境”步骤的旁注......
缺乏管理员权限可能会影响您是否或在哪里可以安装 python 包。

I observed that my installs would hang on the "Solving Environment" step and never get through when attempting to install packages while logged in as a non-administrator.

我观察到我的安装会挂在“解决环境”步骤上,并且在以非管理员身份登录时尝试安装软件包时永远不会通过。

Getting switched to admin was possible for me on the machine I was stuck on, so I just did that and it solved the problem.

在我卡住的机器上切换到管理员是可能的,所以我只是这样做并解决了问题。

Commenter explains workaround when this is not possible.

当这不可能时,评论者解释了解决方法。

回答by Venkat Govindan

conda install --prune <<package>>helped me to install the right channel.

conda install --prune <<package>>帮我安装了正确的频道。

Suspecting environment used are for zipline and channel used not compatible with existing one. prune takes a lot of time but helped me in solving the environment issues.

使用的可疑环境是用于与现有的不兼容的滑索和通道。prune 需要很多时间,但帮助我解决了环境问题。