Python 如何在 Anaconda 中恢复到以前的包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23974217/
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 03:45:50  来源:igfitidea点击:

How do I revert to a previous package in Anaconda?

pythonanacondaconda

提问by chrisaycock

If I do

如果我做

conda info pandas

I can see all of the packages available.

我可以看到所有可用的包。

I updated my pandasto the latest this morning, but I need to revert to a prior version now. I tried

pandas今天早上更新了我的最新版本,但我现在需要恢复到以前的版本。我试过

conda update pandas 0.13.1

but that didn't work. How do I specify which version to use?

但这没有用。如何指定要使用的版本?

采纳答案by chrisaycock

I had to use the installfunction instead:

我不得不改用这个install函数:

conda install pandas=0.13.1

回答by anon01

For the case that you wish to revert a recently installed package that made several changes to dependencies (such as tensorflow), you can "roll back" to an earlier installation state via the following method:

如果您希望恢复最近安装的对依赖项进行了多次更改的包(例如 tensorflow),您可以通过以下方法“回滚”到较早的安装状态:

conda list --revisions
conda install --revision [revision number]

The first command shows previous installation revisions (with dependencies) and the second reverts to whichever revision numberyou specify.

第一个命令显示以前的安装修订(带有依赖项),第二个命令恢复到revision number您指定的任何一个。

Note that if you wish to (re)install a later revision, you may have to sequentially reinstall all intermediate versions. If you had been at revision 23, reinstalled revision 20 and wish to return, you may have to run each:

请注意,如果您希望(重新)安装更高版本,您可能必须按顺序重新安装所有中间版本。如果您使用的是修订版 23,重新安装了修订版 20 并希望返回,您可能必须运行每个:

conda install --revision 21
conda install --revision 22
conda install --revision 23