Skip to content
Advertisement

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. During installation I followed the recommendations given here (installed it only for myself and didn’t add anaconda to the PATH variable). I didn’t change any setting, so you can assume a virgin anaconda with default settings.

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

JavaScript

I got weird error messages:

JavaScript

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. EDIT 1: However, in anaconda navigator the “clone” button is disabled for the base environment which supports this notion.

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)

JavaScript

which yielded the same errors. I tested this on a windows 10 VM as well as a physical windows 10 installation. EDIT 2: I forgot to mention that the cloning process somewhat succeeds as there exists indeed a new environment “base_clone” after execution. However, I don’t feel comfortable ignoring the error messages during the cloning process.

Advertisement

Answer

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:
JavaScript
  1. Open the yaml file. In the first line, change name of the environment in the first line name: base to any other name. In the dependencies list, remove the following nine packages:
  • anaconda=2022.05=py39_0
  • anaconda-navigator=2.1.4=py39haa95532_0
  • conda=4.12.0=py39haa95532_0
  • conda-build=3.21.8=py39haa95532_2
  • conda-env=2.6.0=haa95532_1
  • conda-token=0.3.0=pyhd3eb1b0_0
  • console_shortcut=0.1.1=4
  • powershell_shortcut=0.0.1=3
  • _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). The last package appears to be the offender which needs to be removed additionally.

Save the modified yaml file under a new name, e.g. base_mod.yml

  1. Use the modified yaml file to generate an environment almost identical to the base environment:
JavaScript

Conda, anaconda navigator, jupyter, … work fine with the hereby created environment as far as I can tell. 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.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement