简体   繁体   English

克隆 anaconda 基础环境期间的安全和 Clobber 错误(版本 2022.05)

[英]Safety and Clobber errors during clone of anaconda base environment (Version 2022.05)

I installed the anaconda distribution (version 2022.05) on a windows 10 (64 bit) machine.我在 Windows 10(64 位)机器上安装了 anaconda 发行版(版本 2022.05)。 During installation I followed the recommendations given here (installed it only for myself and didn't add anaconda to the PATH variable).在安装过程中,我遵循了此处给出的建议(仅为我自己安装,并没有将 anaconda 添加到 PATH 变量中)。 I didn't change any setting, so you can assume a virgin anaconda with default settings.我没有更改任何设置,因此您可以假设使用默认设置的处女 anaconda。

I need to install some additional packages which aren't part of the distribution.我需要安装一些不属于发行版的附加软件包。 Hence, I wanted to create a new environment using a clone of the base environment as a starting point.因此,我想创建一个使用基础环境的克隆作为起点的新环境。 However, when I tried to clone base via但是,当我尝试通过

conda create --clone base --name base_clone

I got weird error messages:我收到奇怪的错误消息:

Source:      C:\Users\john.smith\Anaconda3
Destination: C:\Users\john.smith\Anaconda3\envs\base_clone
The following packages cannot be cloned out of the root environment:
 - defaults/win-64::conda-4.12.0-py39haa95532_0
 - defaults/win-64::conda-build-3.21.8-py39haa95532_2
 - defaults/win-64::conda-env-2.6.0-haa95532_1
 - defaults/noarch::conda-token-0.3.0-pyhd3eb1b0_0
 - defaults/win-64::anaconda-2022.05-py39_0
 - defaults/win-64::anaconda-navigator-2.1.4-py39haa95532_0
 - defaults/win-64::console_shortcut-0.1.1-4
 - defaults/win-64::powershell_shortcut-0.0.1-3
Packages: 397
Files: 6
Preparing transaction: done
Verifying transaction: |
SafetyError: The package for _ipyw_jlab_nb_ext_conf located at C:\Users\john.smith\Anaconda3\pkgs\_ipyw_jlab_nb_ext_conf-0.1.0-py39haa95532_0
appears to be corrupted. The path 'Scripts/jupyter-labhub-script.py'
has an incorrect size.
  reported size: 962 bytes
  actual size: 203 bytes

ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/__init__.cpython-39.pyc'

ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/ast_transforms.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/c_ast.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/c_lexer.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/c_parser.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/lextab.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/ply/__pycache__/__init__.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/ply/__pycache__/lex.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/ply/__pycache__/yacc.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/plyparser.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::pycparser-2.21-pyhd3eb1b0_0, defaults/win-64::brotlipy-0.7.0-py39h2bbff1b_1003, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/pycparser/__pycache__/yacctab.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/__init__.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/bdist_wheel.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/cli/__pycache__/__init__.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/macosx_libfile.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/metadata.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/pkginfo.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/util.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/vendored/__pycache__/__init__.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/vendored/packaging/__pycache__/_typing.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0, defaults/win-64::win_inet_pton-1.1.0-py39haa95532_0, defaults/win-64::wrapt-1.12.1-py39h196d8e1_1, defaults/win-64::pysocks-1.7.1-py39haa95532_0, defaults/win-64::yarl-1.6.3-py39h2bbff1b_0, defaults/win-64::pynacl-1.4.0-py39hbd8134f_1, defaults/win-64::bcrypt-3.2.0-py39h196d8e1_0
  path: 'lib/site-packages/wheel/__pycache__/wheelfile.cpython-39.pyc'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/win-64::notebook-6.4.8-py39haa95532_0, defaults/win-64::notebook-6.4.8-py39haa95532_0
  path: 'menu/notebook.json'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::jupyterlab-3.3.2-pyhd3eb1b0_0, defaults/win-64::_ipyw_jlab_nb_ext_conf-0.1.0-py39haa95532_0
  path: 'scripts/jupyter-labhub-script.py'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/noarch::jupyterlab-3.3.2-pyhd3eb1b0_0, defaults/win-64::_ipyw_jlab_nb_ext_conf-0.1.0-py39haa95532_0
  path: 'scripts/jupyter-labhub.exe'


ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/win-64::spyder-5.1.5-py39haa95532_1, defaults/win-64::spyder-5.1.5-py39haa95532_1
  path: 'menu/spyder_shortcut.json'



done
Executing transaction: -

    Windows 64-bit packages of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py


done
#
# To activate this environment, use
#
#     $ conda activate base_clone
#
# To deactivate an active environment, use
#
#     $ conda deactivate

The first part of the message ("The following packages cannot be cloned out of the root environment") is explained in this question which could be related to the safety and clobber errors, I guess?消息的第一部分(“无法从根环境中克隆以下软件包”)在这个问题中进行了解释,这可能与安全和破坏错误有关,我猜? After doing some research I found this issue which suggests that I must not clone the base environment as it is special.在做了一些研究之后,我发现了这个问题,这表明我不能克隆基础环境,因为它很特殊。 This is a bit confusing to me as this is, to my best knowledge, not stated anywhere in the anaconda documentation.这让我有点困惑,因为据我所知,anaconda 文档中的任何地方都没有说明这一点。 EDIT 1: However, in anaconda navigator the "clone" button is disabled for the base environment which supports this notion.编辑 1:但是,在 anaconda 导航器中,支持此概念的基本环境禁用了“克隆”按钮。

Hence, what is the proper way of copying the base environment for my purpose?因此,为我的目的复制基本环境的正确方法是什么?

On a side note: I tried the yml approach as well (I changed the name of the environment in the first line of the yml)附带说明:我也尝试了 yml 方法(我在 yml 的第一行更改了环境的名称)

(base) PS D:\19-05-2022_PythonDeployment> conda env export  --name base > base2305.yml
(base) PS D:\19-05-2022_PythonDeployment> conda env create --file .\base2305.yml

which yielded the same errors.这产生了同样的错误。 I tested this on a windows 10 VM as well as a physical windows 10 installation.我在 Windows 10 VM 以及物理 Windows 10 安装上对此进行了测试。 EDIT 2: I forgot to mention that the cloning process somewhat succeeds as there exists indeed a new environment "base_clone" after execution.编辑2:我忘了提到克隆过程有些成功,因为执行后确实存在一个新环境“base_clone”。 However, I don't feel comfortable ignoring the error messages during the cloning process.但是,在克隆过程中忽略错误消息让我感到不舒服。

I found a solution which results in an almost identical copy of the base environment without any error messages during the cloning process:我找到了一个解决方案,它可以在克隆过程中生成几乎相同的基本环境副本而没有任何错误消息:

  1. Export the base environment to a yaml file:将基础环境导出到 yaml 文件:
conda env export  --name base > base.yml
  1. Open the yaml file.打开 yaml 文件。 In the first line, change name of the environment in the first line name: base to any other name.在第一行中,将第一行name: base中的环境名称更改为任何其他名称。 In the dependencies list, remove the following nine packages:在依赖项列表中,删除以下九个包:
  • anaconda=2022.05=py39_0蟒蛇=2022.05=py39_0
  • anaconda-navigator=2.1.4=py39haa95532_0蟒蛇导航器=2.1.4=py39haa95532_0
  • conda=4.12.0=py39haa95532_0 conda=4.12.0=py39haa95532_0
  • conda-build=3.21.8=py39haa95532_2 conda-build=3.21.8=py39haa95532_2
  • conda-env=2.6.0=haa95532_1 conda-env=2.6.0=haa95532_1
  • conda-token=0.3.0=pyhd3eb1b0_0 conda-token=0.3.0=pyhd3eb1b0_0
  • console_shortcut=0.1.1=4控制台快捷方式=0.1.1=4
  • powershell_shortcut=0.0.1=3 powershell_shortcut=0.0.1=3
  • _ipyw_jlab_nb_ext_conf=0.1.0=py39haa95532_0 _ipyw_jlab_nb_ext_conf=0.1.0=py39haa95532_0

The first eight packages are mentioned by conda to be not clonable (see code section in question). conda 提到前八个包是不可克隆的(请参阅相关代码部分)。 The last package appears to be the offender which needs to be removed additionally.最后一个包裹似乎是需要额外删除的罪犯。

Save the modified yaml file under a new name, eg base_mod.yml以新名称保存修改后的 yaml 文件,例如base_mod.yml

  1. Use the modified yaml file to generate an environment almost identical to the base environment:使用修改后的 yaml 文件生成与基础环境几乎相同的环境:
conda env create --file base_mod.yml

Conda, anaconda navigator, jupyter, ... work fine with the hereby created environment as far as I can tell. Conda,anaconda navigator,jupyter,……据我所知,在特此创建的环境中工作正常。 It's a bit frustrating though that such a basic functionality as cloning the (virgin) base environment required a bit of try and error to get it working.尽管像克隆(原始)基础环境这样的基本功能需要一些尝试和错误才能使其正常工作,但这有点令人沮丧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM