ChatGPT解决这个技术问题 Extra ChatGPT

使用 Conda 批量更新包

有没有办法(使用 conda 更新)我可以列出过时的包并在 Anaconda 中选择或批量更新(兼容)包?

单独更新软件包没有多大意义,因为它们有数百个。


a
asmeurer

你想要conda update --all

conda search --outdated 将显示过时的包,而 conda update --all 将更新它们(请注意,后者不会将您从 Python 2 更新到 Python 3,但如果您确实使用 Python 2,前者会显示 Python 已过时)。


感谢你的回答。我使用python 2。是否可以过滤特定安装版本(py27_0)的过时版本? conda update all 是否只更新我的 py27 环境的兼容版本?
是的,conda update --all 只会安装相互兼容的软件包,它不会将您从 Python 2 更新到 Python 3。
conda search --outdated 向您显示每个已安装和过时的软件包的所有可用版本,这在很多情况下有点过多,,,我个人更喜欢使用 conda update --all,它显示将要安装的内容并提示确认:您回复 N,您就有了一份过时软件包的精简列表。
conda update --allconda search --outdated 的不同之处还在于它通过求解器运行,这意味着如果其他包具有依赖性限制(或者,例如,conda update --all 不会从 Python 2.7 更新),则某些具有较新版本的包可能不会更新到 Python 3.4)。
我刚刚发现 this blog,作者 Jake VanderPlas 对 Anacondaconda 进行了一些术语解释。它回答了我的许多问题。
A
Adam Batkin

在继续执行 conda update --all 命令之前,如果您很长时间没有更新 conda,请先使用 conda update conda 命令更新 conda。它发生在我身上(Anaconda 64 位上的 Python 2.7.13)。


64位,你的意思是?
至少,作为评论可能比作为答案更有意义。
“发生在我身上”,你怎么了?
T
Tiago Cogumbreiro

Conda 包管理器几乎已准备好进行 beta 测试,但在 Spyder 2.4 (https://github.com/spyder-ide/spyder/wiki/Roadmap) 发布之前它不会完全集成。一旦我们准备好进行测试,我们就会在邮件列表 (https://groups.google.com/forum/#!forum/spyderlib) 上发布一些内容。一定要订阅

干杯!


这个答案如何回答这个问题?
N
Naveen Reddy Marthala
# list packages that can be updated
conda search --outdated

# update all packages prompted(by asking the user yes/no)
conda update --all

# update all packages unprompted
conda update --all -y