如何恢复到Anaconda中的先前软件包?

问题:如何恢复到Anaconda中的先前软件包?

如果我做

conda info pandas

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

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

conda update pandas 0.13.1

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

If I do

conda info pandas

I can see all of the packages available.

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

conda update pandas 0.13.1

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


回答 0

我不得不改用该install函数:

conda install pandas=0.13.1

I had to use the install function instead:

conda install pandas=0.13.1

回答 1

对于希望还原最近安装的软件包的情况,该软件包对依赖项进行了一些更改(例如tensorflow),可以通过以下方法“回滚”到较早的安装状态:

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

第一个命令显示以前的安装版本(带有依赖项),第二个命令还原到revision number您指定的版本。

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

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

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:

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

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

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:

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