Anaconda python:尝试回滚修订时出现PackagesNotFoundError错误

2024-05-08 15:08:23 发布

您现在位置:Python中文网/ 问答频道 /正文

出于某种原因,我决定升级setuptools。当我运行conda install -c anaconda setuptools时弹出的所谓包计划如下:

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的最新修订是:

^{pr2}$

现在的问题是,当我conda install --revision 12时,我会得到以下错误:

PackagesNotFoundError: The following packages are missing from the target environment:
    - anaconda::certifi==2018.11.29=py36_0

你知道怎么做回滚吗?在

非常感谢


Tags: thekbmainpackagesanacondabecondawill
2条回答

看来你是通过 发出一系列conda install命令。 你可以继续这样做, 命令行上有一个附加的版本规范。 但我鼓励你改用这种方法:

创建一个如下所示的environment.yml文件。在

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可以看到它们的安装位置。)

这种方法的一个优点是您可以轻松地 rm -rf ~/miniconda3/envs/myproject/ (或安装在何处) 然后conda env update从头重新安装。 这通常可以解决versionitis问题, 或者至少提供了一个提示 关于哪些版本约束应该放宽 允许一个可行的解决方案。在

只是万一有人碰到这种情况,面对类似的情况,这是我所做的,公平地说,这并不是一种倒退。我的conda环境似乎真的搞砸了我在原始帖子中提到的升级,因为当我做conda update conda时,我收到了以下错误:

>conda update conda
Collecting package metadata: done
Solving environment: | WARNING 
conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pycosat".
WARNING conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pycryptosat".
WARNING conda.common.logic:get_sat_solver_cls(289): Could not run SAT solver through interface "pysat".failed

我的小宝贝也坏了,谁知道还有什么。。。。在

我遵循了Kale Franz在这个链接上描述的步骤:https://github.com/conda/conda/issues/7714#issuecomment-417553149

为了完整起见,我附上以下截图: enter image description here

运行Kale在他的帖子中建议的命令,我得到了一个非常长的导致不一致的包的列表。我是一个很长的列表,我只是在最开始的几行下面粘贴:

^{pr2}$

名单结束后,信息继续如下:

The following packages will be downloaded:

package                    |            build
             -|        -
ca-certificates-2019.5.15  |                0         166 KB
certifi-2019.3.9           |           py36_0         156 KB
cffi-1.12.3                |   py36h7a1dbc1_0         225 KB
chardet-3.0.4              |           py36_1         210 KB
conda-4.6.14               |           py36_0         2.1 MB
cryptography-2.7           |   py36h7a1dbc1_0         564 KB
idna-2.8                   |           py36_0         134 KB
menuinst-1.4.16            |   py36he774522_0         227 KB
openssl-1.1.1c             |       he774522_1         5.7 MB
pip-19.1.1                 |           py36_0         1.9 MB
pycosat-0.6.3              |   py36hfa6e2cd_0          98 KB
pycparser-2.19             |           py36_0         174 KB
pyopenssl-19.0.0           |           py36_0          82 KB
pysocks-1.7.0              |           py36_0          30 KB
python-3.6.8               |       h9f7ef89_7        20.3 MB
pywin32-223                |   py36hfa6e2cd_1         9.3 MB
requests-2.22.0            |           py36_0          90 KB
ruamel_yaml-0.15.46        |   py36hfa6e2cd_0         262 KB
setuptools-41.0.1          |           py36_0         663 KB
six-1.12.0                 |           py36_0          22 KB
urllib3-1.24.2             |           py36_0         153 KB
wheel-0.33.4               |           py36_0          57 KB
win_inet_pton-1.1.0        |           py36_0           9 KB
wincertstore-0.2           |   py36h7fe50ca_0          13 KB
                              
                                       Total:        42.6 MB

The following packages will be UPDATED:

  ca-certificates     anaconda::ca-certificates-2019.1.23-0  > pkgs/main::ca-certificates-2019.5.15-0
  cffi                                1.11.4-py36hfa6e2cd_0  > 1.12.3-py36h7a1dbc1_0
  conda                        anaconda::conda-4.6.2-py36_0  > pkgs/main::conda-4.6.14-py36_0
  cryptography                         2.4.2-py36h7a1dbc1_0  > 2.7-py36h7a1dbc1_0
  idna                                   2.6-py36h148d497_1  > 2.8-py36_0
  menuinst                            1.4.11-py36hfa6e2cd_0  > 1.4.16-py36he774522_0
  pycparser                             2.18-py36hd053e01_1  > 2.19-py36_0
  pyopenssl                           17.5.0-py36h5b7d817_0  > 19.0.0-py36_0
  pysocks                              1.6.7-py36h698d350_1  > 1.7.0-py36_0
  pywin32                                222-py36hfa6e2cd_0  > 223-py36hfa6e2cd_1
  requests                            2.18.4-py36h4371aae_1  > 2.22.0-py36_0
  ruamel_yaml                        0.15.35-py36hfa6e2cd_1  > 0.15.46-py36hfa6e2cd_0
  six                                 1.11.0-py36h4db2310_1  > 1.12.0-py36_0
  urllib3                               1.22-py36h276f60a_0  > 1.24.2-py36_0
  win_inet_pton                        1.0.1-py36he67d7fd_1  > 1.1.0-py36_0

The following packages will be SUPERSEDED by a higher-priority channel:

certifi                 anaconda::certifi-2019.3.9-py37_0  > pkgs/main::certifi-2019.3.9-py36_0
openssl                anaconda::openssl-1.1.1-he774522_0  > pkgs/main::openssl-1.1.1c-he774522_1
pip                           anaconda::pip-19.1.1-py37_0  > pkgs/main::pip-19.1.1-py36_0
python                 anaconda::python-3.7.2-h8c8aaf0_10  > pkgs/main::python-3.6.8-h9f7ef89_7
setuptools             anaconda::setuptools-41.0.1-py37_0  > pkgs/main::setuptools-41.0.1-py36_0
wheel                       anaconda::wheel-0.33.4-py37_0  > pkgs/main::wheel-0.33.4-py36_0
wincertstore            anaconda::wincertstore-0.2-py37_0  > pkgs/main::wincertstore-0.2-py36h7fe50ca_0

The following packages will be DOWNGRADED:

 chardet                              3.0.4-py36h420ce6e_1  > 3.0.4-py36_1
 pycosat                              0.6.3-py36h413d8a4_0  > 0.6.3-py36hfa6e2cd_0


Proceed ([y]/n)? y

现在一切都很好,如果我做了conda list revisions我最近的两个修订是:

 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)}

 2019-06-10 14:05:10  (rev 14)
     ca-certificates  {2019.1.23 (anaconda) -> 2019.5.15}
     certifi  {2019.3.9 (anaconda) -> 2019.3.9}
     cffi  {1.11.4 -> 1.12.3}
     chardet  {3.0.4 -> 3.0.4}
     conda  {4.6.2 (anaconda) -> 4.6.14}
     cryptography  {2.4.2 -> 2.7}
     idna  {2.6 -> 2.8}
     menuinst  {1.4.11 -> 1.4.16}
     openssl  {1.1.1 (anaconda) -> 1.1.1c}
     pip  {19.1.1 (anaconda) -> 19.1.1}
     pycosat  {0.6.3 -> 0.6.3}
     pycparser  {2.18 -> 2.19}
     pyopenssl  {17.5.0 -> 19.0.0}
     pysocks  {1.6.7 -> 1.7.0}
     python  {3.7.2 (anaconda) -> 3.6.8}
     pywin32  {222 -> 223}
     requests  {2.18.4 -> 2.22.0}
     ruamel_yaml  {0.15.35 -> 0.15.46}
     setuptools  {41.0.1 (anaconda) -> 41.0.1}
     six  {1.11.0 -> 1.12.0}
     urllib3  {1.22 -> 1.24.2}
     wheel  {0.33.4 (anaconda) -> 0.33.4}
     win_inet_pton  {1.0.1 -> 1.1.0}
     wincertstore  {0.2 (anaconda) -> 0.2}

相关问题 更多 >