问题描述
出于某种原因,我决定升级setuptools
.我运行conda install -c anaconda setuptools
时弹出的所谓打包计划如下:
For some reason I decided to upgrade setuptools
. The so-called package plan that popped up when I ran conda install -c anaconda setuptools
was as follows:
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2019.3.9 | py37_0 155 KB anaconda
pip-19.1.1 | py37_0 1.8 MB anaconda
python-3.7.2 | h8c8aaf0_10 17.7 MB anaconda
setuptools-41.0.1 | py37_0 680 KB anaconda
wheel-0.33.4 | py37_0 57 KB anaconda
wincertstore-0.2 | py37_0 13 KB anaconda
------------------------------------------------------------
Total: 20.4 MB
The following NEW packages will be INSTALLED:
pip anaconda/win-64::pip-19.1.1-py37_0
The following packages will be UPDATED:
certifi 2018.11.29-py36_0 --> 2019.3.9-py37_0
python pkgs/main::python-3.6.4-h6538335_1 --> anaconda::python-3.7.2-h8c8aaf0_10
setuptools pkgs/main::setuptools-38.4.0-py36_0 --> anaconda::setuptools-41.0.1-py37_0
wheel pkgs/main::wheel-0.30.0-py36h6c3ec14_1 --> anaconda::wheel-0.33.4-py37_0
The following packages will be SUPERSEDED by a higher-priority channel:
wincertstore pkgs/main::wincertstore-0.2-py36h7fe5~ --> anaconda::wincertstore-0.2-py37_0
但是,升级破坏了我代码的其他真正需要的部分,无法更新.因此,我决定回滚到以前的状态. conda list --revisions
的最新修订为:
However the upgrade broke other parts of my code which are really needed and cannot be updated. Hence I decide to roll back to the previous state. The most recent revisions from conda list --revisions
are:
2019-02-12 15:10:38 (rev 12)
bzip2 {1.0.6 (conda-forge) -> 1.0.6 (anaconda)}
ca-certificates {2018.03.07 -> 2019.1.23 (anaconda)}
certifi {2018.11.29 -> 2018.11.29 (anaconda)}
conda {4.5.12 -> 4.6.2 (anaconda)}
nbconvert {5.3.1 -> 5.4.0 (anaconda)}
openssl {1.1.1a -> 1.1.1 (anaconda)}
snappy {1.1.7 (conda-forge) -> 1.1.7 (anaconda)}
vc {14.1 -> 14.1 (anaconda)}
vs2015_runtime {14.15.26706 -> 15.5.2 (anaconda)}
yaml {0.1.7 (conda-forge) -> 0.1.7 (anaconda)}
zlib {1.2.11 (conda-forge) -> 1.2.11 (anaconda)}
+defusedxml-0.5.0 (anaconda)
2019-05-17 16:52:29 (rev 13)
certifi {2018.11.29 (anaconda) -> 2019.3.9 (anaconda)}
pip {9.0.1 -> 19.1.1 (anaconda)}
python {3.6.4 -> 3.7.2 (anaconda)}
setuptools {38.4.0 -> 41.0.1 (anaconda)}
wheel {0.30.0 -> 0.33.4 (anaconda)}
wincertstore {0.2 -> 0.2 (anaconda)}
现在的问题是,当我执行conda install --revision 12
时,出现以下错误:
The problem now is that when I do conda install --revision 12
I get the following error:
PackagesNotFoundError: The following packages are missing from the target environment:
- anaconda::certifi==2018.11.29=py36_0
请问如何进行回滚的任何想法?
Any ideas how to do the rollback please?
非常感谢
推荐答案
看来您正在维护环境发出一系列conda install
命令.您可以继续这样做,在命令行上带有附加的版本说明.但我鼓励您改用这种方法:
It appears you are maintaining your environment byissuing a series of conda install
commands.You could continue to do this,with an additional version specification on the command line.But I encourage you to switch to this approach:
创建一个如下所示的environment.yml
文件.
Create an environment.yml
file that looks like this.
name: myproject
channels:
- defaults
- conda-forge
dependencies:
- bzip2 >= 1.0.6
- pip >= 19.1.1
- snappy >= 1.1.7
- zlib >= 1.2.11
根据需要添加其他人.
使用conda env update
安装软件包.(使用which python
,您可以看到它们的安装位置.)
Use conda env update
to install the packages.(With which python
you can see where they were installed.)
此方法的优点是您可以轻松地rm -rf ~/miniconda3/envs/myproject/
(或安装它们的任何地方)然后conda env update
重新从头开始安装.这通常可以解决版本炎问题,或至少提供一个提示关于应该放宽哪些版本限制提供可行的解决方案.
An advantage of this approach is you can easilyrm -rf ~/miniconda3/envs/myproject/
(or wherever they were installed)and then conda env update
to re-install from scratch.This typically resolves versionitis problems,or at least offers a hintabout which version constraints should be relaxedto permit a feasible solution.
这篇关于尝试回滚修订时,Anaconda python:PackagesNotFoundError错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!