Anaconda 4.7.5 - 关于 conda-build <3.18.3 和 python 包问题的警告

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

Anaconda 4.7.5 - Warning about conda-build <3.18.3 and issues with python packages

pythonanacondaconda

提问by krishnab

I run the Anaconda python distribution on Ubuntu Linux 18.04 LTS x64 and just updated the distribution with the usual conda update --all. After that, the command line message suggested updating the conda base defaults. Now for some reason, I am having a couple of issues. First, I am unable to launch jupyter lab, even after trying to reinstall conda install jupyter. And second I am getting this new warning message.

我在 Ubuntu Linux 18.04 LTS x64 上运行 Anaconda python 发行版,并使用通常的conda update --all. 之后,命令行消息建议更新 conda 基础默认值。现在出于某种原因,我有几个问题。首先,jupyter lab即使在尝试重新安装conda install jupyter. 其次,我收到了这条新的警告消息。

    WARNING conda.base.context:use_only_tar_bz2(632):
 Conda is constrained to only using the old .tar.bz2
 file format because you have conda-build installed,
 and it is <3.18.3.  Update or remove conda-build to
 get smaller downloads and faster extractions.

So I looked and found this blog postfrom today about making Anaconda faster. But the post seems to be more information and does not seem to recommend upgrading right away.

所以我从今天开始查看并找到了这篇关于使 Anaconda 更快的博客文章。但是帖子好像信息比较多,好像不建议马上升级。

Here is the output from conda info.

这是来自conda info.

     active environment : XXX
    active env location : XXX
            shell level : 2
       user config file : ../.condarc
 populated config files : ../.condarc
          conda version : 4.7.5
    conda-build version : 3.17.8
         python version : 3.6.6.final.0
       virtual packages : __cuda=10.1
       base environment : ../anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : ../.conda/pkgs
       envs directories : ../.conda/envs
               platform : linux-64
             user-agent : conda/4.7.5 requests/2.22.0 CPython/3.6.6 Linux/4.15.0-50-generic ubuntu/18.04.2 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Has anyone else run into this issue? Should I delete my old anaconda distribution and download and install the new version of 4.7, or is there a simpler fix?

有没有其他人遇到过这个问题?我应该删除旧的 anaconda 发行版并下载并安装 4.7 的新版本,还是有更简单的修复方法?

UPDATE

更新

So I did post this issue to the condarepo on Github. The current issue open against this problem is listed below. According to msarahanhere is the basis of the problem and just a temporary workaround

所以我确实将此问题发布到condaGithub上的repo。下面列出了针对此问题的当前问题。根据msarahan这里是问题的基础,只是一个临时的解决方法

https://github.com/conda/conda/issues/8842

https://github.com/conda/conda/issues/8842

  1. anaconda is a meta-package. Each version consists of a set of versions that have all gone through QA together as a set. If you change any version of any package in that collection, you no longer have that metapackage, because you have strayed from that known set. There is a special version of that metapackage, custom, that is meant to handle this relaxation of constraints. The "custom" version depends only on a particular version of python - it removes the constraints on all other packages.

  2. conda 4.7 builds up its candidates for addition differently from earlier conda versions. It starts with specs from the history, and tries to constrain things where it can, to speed up the solution. When conda finds the anaconda metapackage with the "custom" version, it keeps it, but all of those other dependencies are now orphaned. This is why conda is removing them - they have no spec in the history that tells conda to keep them.

You can restore these by running conda install --only-deps anaconda. From then on, all of those packages are considered part of your explicit history, and you won't have further problems like this.

  1. anaconda 是一个元包。每个版本都由一组版本组成,这些版本都作为一个集合一起通过了 QA。如果您更改该集合中任何包的任何版本,您将不再拥有该元包,因为您已经偏离了该已知集合。有一个特殊版本的元包,custom,旨在处理这种限制的放松。“自定义”版本仅取决于特定版本的 python - 它消除了对所有其他包的限制。

  2. conda 4.7 以不同于早期 conda 版本的方式构建其候选对象。它从历史规范开始,并试图在可能的地方限制事物,以加速解决方案。当 conda 找到具有“自定义”版本的 anaconda 元包时,它会保留它,但所有其他依赖项现在都被孤立了。这就是 conda 删除它们的原因 - 他们在历史中没有告诉 conda 保留它们的规范。

您可以通过运行来恢复这些conda install --only-deps anaconda。从那时起,所有这些包都被视为您的显式历史记录的一部分,您将不会再遇到此类问题。

采纳答案by James Owers

conda activate base  # or just conda deactivate
conda update conda-build

(Or simply conda update -n base -c defaults conda-build)

(或者干脆conda update -n base -c defaults conda-build

If this doesn't fix, try rolling back to before your update to 4.7.5, as @LeninGF suggests, then removing conda metadata, cleaning up conda, then try the update again i.e.

如果这不能解决,请尝试回滚到更新之前4.7.5,如@LeninGF 建议的那样,然后删除 conda 元数据,清理 conda,然后再次尝试更新,即

conda list --revisions  # find number, x, before the update
conda install --revision x
rm -rf ~/.conda
conda clean --all
conda update conda

回答by LeninGF

I just ran into the same problem by updating. The following helped me to recover base environment. I am testing in another environment to see if it works.

我刚刚通过更新遇到了同样的问题。以下帮助我恢复了基础环境。我正在另一个环境中测试它是否有效。

conda list --revisions
conda install --revision  dd

Where ddis the number of the revision you wish to go back to

其中dd是您希望返回的修订号

For instance:

例如:

conda install --revision 8

This helped me to recover my base conda environment. Unfortunately for the tensorflow environment I had created, I had to re-install. It is also advisable to create a yaml file of your environment once you get it working so you can reinstall anytime. This is done with

这帮助我恢复了我的基本 conda 环境。不幸的是,对于我创建的 tensorflow 环境,我不得不重新安装。还建议在您的环境运行后创建一个 yaml 文件,以便您可以随时重新安装。这是用

conda env export > name.yaml

You need to activate your anaconda environment for that to work and point to a location in your disk where you want to store the file.

您需要激活 anaconda 环境才能工作并指向磁盘中要存储文件的位置。

For creating the environment from the yaml file just use:

要从 yaml 文件创建环境,只需使用:

conda env create -f name.yaml

In order to make it easy I attach here the result I get for my tensorflow-gpu environment (you can see I have up to 11 revisions). Not an expert on conda but it seems that revisions work as git, recording your changes and letting you go back to them. However It seems also that it depends on weather you have the back up files of installations in conda environment which probably get lost when you run conda clean command:

为了方便起见,我在此附上我在 tensorflow-gpu 环境中获得的结果(您可以看到我有多达 11 个修订版)。不是 conda 方面的专家,但似乎修订像 git 一样工作,记录您的更改并让您返回到它们。但是,这似乎也取决于天气,您在 conda 环境中拥有安装的备份文件,当您运行 conda clean 命令时,这些文件可能会丢失:

(base) leninml@Lenin:~$ conda activate tf_gpu_10
(tf_gpu_10) leninml@Lenin:~$ conda list --revisions
2019-06-26 12:50:10  (rev 0)

2019-06-26 12:59:19  (rev 1)
    +_tflow_select-2.1.0 (anaconda)
    +absl-py-0.7.1 (anaconda)
    +astor-0.7.1 (anaconda)
    +blas-1.0 (anaconda)
    +c-ares-1.15.0 (anaconda)
    +ca-certificates-2019.5.15 (anaconda)
    +certifi-2019.6.16 (anaconda)
    +cudatoolkit-10.0.130 (anaconda)
    +cudnn-7.6.0 (anaconda)
    +cupti-10.0.130 (anaconda)
    +gast-0.2.2 (anaconda)
    +grpcio-1.16.1 (anaconda)
    +h5py-2.9.0 (anaconda)
    +hdf5-1.10.4 (anaconda)
    +intel-openmp-2019.4 (anaconda)
    +keras-applications-1.0.8 (anaconda)
    +keras-preprocessing-1.1.0 (anaconda)
    +libedit-3.1.20181209 (anaconda)
    +libffi-3.2.1 (anaconda)
    +libgcc-ng-9.1.0 (anaconda)
    +libgfortran-ng-7.3.0 (anaconda)
    +libprotobuf-3.8.0 (anaconda)
    +libstdcxx-ng-9.1.0 (anaconda)
    +markdown-3.1.1 (anaconda)
    +mkl-2019.4 (anaconda)
    +mkl_fft-1.0.12 (anaconda)
    +mkl_random-1.0.2 (anaconda)
    +mock-3.0.5 (anaconda)
    +ncurses-6.1 (anaconda)
    +numpy-1.16.4 (anaconda)
    +numpy-base-1.16.4 (anaconda)
    +openssl-1.1.1 (anaconda)
    +pip-19.1.1 (anaconda)
    +protobuf-3.8.0 (anaconda)
    +python-3.7.3 (anaconda)
    +readline-7.0 (anaconda)
    +scipy-1.2.1 (anaconda)
    +setuptools-41.0.1 (anaconda)
    +six-1.12.0 (anaconda)
    +sqlite-3.28.0 (anaconda)
    +tensorboard-1.13.1 (anaconda)
    +tensorflow-1.13.1 (anaconda)
    +tensorflow-base-1.13.1 (anaconda)
    +tensorflow-estimator-1.13.0 (anaconda)
    +tensorflow-gpu-1.13.1 (anaconda)
    +termcolor-1.1.0 (anaconda)
    +tk-8.6.8 (anaconda)
    +werkzeug-0.15.4 (anaconda)
    +wheel-0.33.4 (anaconda)
    +xz-5.2.4 (anaconda)
    +zlib-1.2.11 (anaconda)

2019-06-26 13:00:52  (rev 2)
    +backcall-0.1.0 (anaconda)
    +decorator-4.4.0 (anaconda)
    +ipython-7.5.0 (anaconda)
    +ipython_genutils-0.2.0 (anaconda)
    +jedi-0.13.3 (anaconda)
    +parso-0.4.0 (anaconda)
    +pexpect-4.7.0 (anaconda)
    +pickleshare-0.7.5 (anaconda)
    +prompt_toolkit-2.0.9 (anaconda)
    +ptyprocess-0.6.0 (anaconda)
    +pygments-2.4.2 (anaconda)
    +traitlets-4.3.2 (anaconda)
    +wcwidth-0.1.7 (anaconda)

2019-06-26 13:05:42  (rev 3)
     blas  {1.0 (anaconda) -> 2.7 (conda-forge)}
     ca-certificates  {2019.5.15 (anaconda) -> 2019.6.16 (conda-forge)}
     certifi  {2019.6.16 (anaconda) -> 2019.6.16 (conda-forge)}
     grpcio  {1.16.1 (anaconda) -> 1.16.1}
     mkl_fft  {1.0.12 (anaconda) -> 1.0.13 (conda-forge)}
     mkl_random  {1.0.2 (anaconda) -> 1.0.4 (conda-forge)}
     numpy  {1.16.4 (anaconda) -> 1.16.4}
     numpy-base  {1.16.4 (anaconda) -> 1.16.4}
     openssl  {1.1.1 (anaconda) -> 1.1.1b (conda-forge)}
     scipy  {1.2.1 (anaconda) -> 1.3.0 (conda-forge)}
    +joblib-0.13.2 (conda-forge)
    +libblas-3.8.0 (conda-forge)
    +libcblas-3.8.0 (conda-forge)
    +liblapack-3.8.0 (conda-forge)
    +liblapacke-3.8.0 (conda-forge)
    +libopenblas-0.3.6
    +openblas-0.3.5 (conda-forge)
    +scikit-learn-0.21.2 (conda-forge)

2019-06-26 13:08:05  (rev 4)
     tk  {8.6.8 (anaconda) -> 8.6.9 (conda-forge)}
    +cycler-0.10.0 (conda-forge)
    +dbus-1.13.6 (conda-forge)
    +expat-2.2.5 (conda-forge)
    +fontconfig-2.13.1 (conda-forge)
    +freetype-2.10.0 (conda-forge)
    +gettext-0.19.8.1 (conda-forge)
    +glib-2.58.3 (conda-forge)
    +gst-plugins-base-1.14.5 (conda-forge)
    +gstreamer-1.14.5 (conda-forge)
    +icu-58.2 (conda-forge)
    +jpeg-9c (conda-forge)
    +kiwisolver-1.1.0 (conda-forge)
    +libiconv-1.15 (conda-forge)
    +libpng-1.6.37 (conda-forge)
    +libuuid-2.32.1 (conda-forge)
    +libxcb-1.13 (conda-forge)
    +libxml2-2.9.9 (conda-forge)
    +matplotlib-3.1.0 (conda-forge)
    +matplotlib-base-3.1.0 (conda-forge)
    +pcre-8.41 (conda-forge)
    +pthread-stubs-0.4 (conda-forge)
    +pyparsing-2.4.0 (conda-forge)
    +pyqt-5.9.2 (conda-forge)
    +python-dateutil-2.8.0 (conda-forge)
    +qt-5.9.7 (conda-forge)
    +sip-4.19.8 (conda-forge)
    +tornado-6.0.3 (conda-forge)
    +xorg-libxau-1.0.9 (conda-forge)
    +xorg-libxdmcp-1.1.3 (conda-forge)

2019-06-26 13:10:31  (rev 5)
     ca-certificates  {2019.6.16 (conda-forge) -> 2019.5.15 (anaconda)}
     certifi  {2019.6.16 (conda-forge) -> 2019.6.16 (anaconda)}
     openssl  {1.1.1b (conda-forge) -> 1.1.1 (anaconda)}
    +cloudpickle-1.1.1 (anaconda)
    +cytoolz-0.9.0.1 (anaconda)
    +dask-core-1.2.2 (anaconda)
    +imageio-2.5.0 (anaconda)
    +libtiff-4.0.10 (anaconda)
    +networkx-2.3 (anaconda)
    +olefile-0.46 (anaconda)
    +pillow-6.0.0 (anaconda)
    +pywavelets-1.0.3 (anaconda)
    +scikit-image-0.15.0 (anaconda)
    +toolz-0.9.0 (anaconda)
    +zstd-1.3.7 (anaconda)

2019-06-26 13:12:14  (rev 6)
     ca-certificates  {2019.5.15 (anaconda) -> 2019.6.16 (conda-forge)}
     certifi  {2019.6.16 (anaconda) -> 2019.6.16 (conda-forge)}
     openssl  {1.1.1 (anaconda) -> 1.1.1b (conda-forge)}
    +tensorflow-hub-0.5.0 (conda-forge)

2019-06-26 13:13:00  (rev 7)
     tensorboard  {1.13.1 (anaconda) -> 1.13.1 (conda-forge)}

2019-06-26 13:13:47  (rev 8)
     ca-certificates  {2019.6.16 (conda-forge) -> 2019.5.15 (anaconda)}
     certifi  {2019.6.16 (conda-forge) -> 2019.6.16 (anaconda)}
     openssl  {1.1.1b (conda-forge) -> 1.1.1 (anaconda)}
    +pandas-0.24.2 (anaconda)
    +pytz-2019.1 (anaconda)

2019-06-26 13:14:36  (rev 9)
     ca-certificates  {2019.5.15 (anaconda) -> 2019.6.16 (conda-forge)}
     certifi  {2019.6.16 (anaconda) -> 2019.6.16 (conda-forge)}
     openssl  {1.1.1 (anaconda) -> 1.1.1b (conda-forge)}
    +pydicom-1.2.2 (conda-forge)

2019-06-26 13:19:06  (rev 10)
     ca-certificates  {2019.6.16 (conda-forge) -> 2019.5.15 (anaconda)}
     certifi  {2019.6.16 (conda-forge) -> 2019.6.16 (anaconda)}
     openssl  {1.1.1b (conda-forge) -> 1.1.1 (anaconda)}
    +attrs-19.1.0 (anaconda)
    +bleach-3.1.0 (anaconda)
    +defusedxml-0.6.0 (anaconda)
    +entrypoints-0.3 (anaconda)
    +gmp-6.1.2 (anaconda)
    +ipykernel-5.1.1 (anaconda)
    +ipywidgets-7.4.2 (anaconda)
    +jinja2-2.10.1 (anaconda)
    +jsonschema-3.0.1 (anaconda)
    +jupyter-1.0.0 (anaconda)
    +jupyter_client-5.2.4 (anaconda)
    +jupyter_console-6.0.0 (anaconda)
    +jupyter_core-4.4.0 (anaconda)
    +libsodium-1.0.16 (anaconda)
    +markupsafe-1.1.1 (anaconda)
    +mistune-0.8.4 (anaconda)
    +nbconvert-5.5.0 (anaconda)
    +nbformat-4.4.0 (anaconda)
    +notebook-5.7.8 (anaconda)
    +pandoc-2.2.3.2 (anaconda)
    +pandocfilters-1.4.2 (anaconda)
    +prometheus_client-0.6.0 (anaconda)
    +pyrsistent-0.14.11 (anaconda)
    +pyzmq-18.0.0 (anaconda)
    +qtconsole-4.5.1 (anaconda)
    +send2trash-1.5.0 (anaconda)
    +terminado-0.8.2 (anaconda)
    +testpath-0.4.2 (anaconda)
    +webencodings-0.5.1 (anaconda)
    +widgetsnbextension-3.4.2 (anaconda)
    +zeromq-4.3.1 (anaconda)

2019-06-26 13:33:00  (rev 11)
     ca-certificates  {2019.5.15 (anaconda) -> 2019.6.16 (conda-forge)}
     certifi  {2019.6.16 (anaconda) -> 2019.6.16 (conda-forge)}
     openssl  {1.1.1 (anaconda) -> 1.1.1b (conda-forge)}
    +binutils_impl_linux-64-2.31.1
    +binutils_linux-64-2.31.1
    +gcc_impl_linux-64-7.3.0 (conda-forge)
    +gcc_linux-64-7.3.0 (conda-forge)
    +gxx_impl_linux-64-7.3.0 (conda-forge)
    +gxx_linux-64-7.3.0 (conda-forge)
    +keras-2.2.4 (conda-forge)
    +libgpuarray-0.7.6 (conda-forge)
    +mako-1.0.10 (conda-forge)
    +pygpu-0.7.6 (conda-forge)
    +pyyaml-5.1.1 (conda-forge)
    +theano-1.0.4 (conda-forge)
    +yaml-0.1.7 (conda-forge)

回答by NellieK

conda update conda-build

Output:

输出:

The following packages will be UPDATED:
conda-build                                 3.17.8-py37_0 --> 3.18.5-py37_0

The output of the conda infocommand (the conda-build has been updated from 3.17.8):

conda info命令的输出(conda-build 已从 3.17.8 更新):

     active environment : None
       user config file : /Users/<user>/.condarc
 populated config files : /Users/<user>/.condarc
          conda version : 4.7.5
    conda-build version : 3.18.5
         python version : 3.7.3.final.0
       virtual packages : 
       base environment : /Users/<user>/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/<user>/anaconda3/pkgs
                          /Users/<user>/.conda/pkgs
       envs directories : /Users/<user>/anaconda3/envs
                          /Users/<user>/.conda/envs
               platform : osx-64
             user-agent : conda/4.7.5 requests/2.21.0 CPython/3.7.3 Darwin/18.5.0 OSX/10.14.4
                UID:GID : 501:20
             netrc file : /Users/<user>/.netrc
           offline mode : False

回答by Kris Stern

The command conda update conda-buildworked for me too, and there is no need to first run pip install conda-buildprior to running it.

该命令conda update conda-build也对我有用,pip install conda-build在运行它之前无需先运行。

Afterwards, the warning is gone.

之后,警告消失了。

回答by Mike

To me the solution was (in the Anaconda Prompt) running the following:

对我来说,解决方案是(在 Anaconda Prompt 中)运行以下命令:

  • conda install anaconda
  • conda update conda-build
  • conda update --all
  • conda install anaconda
  • conda update conda-build
  • conda update --all

After that the warning message disappear and I could update/install packages again.

之后警告消息消失,我可以再次更新/安装软件包。

回答by Fernando L Couto

I use Linux64 and after an installation yesterday I had the following problem: warning to update "conda-build" came along with "Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3. Update or remove conda-build to get smaller downloads and faster extractions". I followed the steps indicated by @msarahan in an issue in GitHub - go to: https://github.com/conda/conda/issues/8832.

我使用 Linux64,昨天安装后我遇到了以下问题:警告更新“conda-build”伴随着“ Conda 被限制只能使用旧的 .tar.bz2 文件格式,因为你安装了 conda-build,它是 <3.18.3。更新或删除 conda-build 以获得更小的下载和更快的提取“。我按照@msarahan 在 GitHub 中的一个问题中指出的步骤 - 转到:https: //github.com/conda/conda/issues/8832

Steps:

脚步:

1 - install anaconda from https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh
2 - update conda: conda update conda
3 - conda install hdf5 - "see the warning"
4 - conda update conda-build "(conda-build is part of anaconda since 2018.12, IIRC)"

1 - 从https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh安装 anaconda
2 - 更新 conda:conda 更新 conda
3 - conda install hdf5 - “查看警告
4 - conda 更新 conda -build “(自 2018.12 以来,conda-build 是 anaconda 的一部分,IIRC)”

5 - conda install hdf5 - "warning is gone"

5 - conda install hdf5 - “警告消失

It works for me. I hope that helps.

这个对我有用。我希望这有帮助。

回答by Shahar Ofir

I've done the following things: Tried both remove and updateconda-build, however, it didn't found the package

我做了以下事情: 尝试了 remove 和 update conda-build,但是,它没有找到包

  1. Pip install conda-build
  2. It gave me an error, but I could do afterward
  3. Conda install conda-build
  1. Pip install conda-build
  2. 它给了我一个错误,但我之后可以做
  3. Conda install conda-build

Problem solved

问题解决了

Hope it helps

希望能帮助到你