Python – Create a Conda environment on top of an existing installation

Create a Conda environment on top of an existing installation… here is a solution to the problem.

Create a Conda environment on top of an existing installation

I have installed miniconda3 on my system using the bash install script and then executed conda install some packages into this installation.

This installation is available as read-only to other users. THEY CAN GET AN INSTALLATION SCRIPT THAT ADDS THE CONDA INSTALLATION TO THEIR LD_LIBRARY_PATH, PATH, AND PYTHONPATH.

I want users to be able to add their own custom modules on top of this environment.

Ideally, users would run some form of conda create environment, which would result in users being able to install packages in their local environment, but would get previously installed packages from my region.

Is there any good way?

The important point is that my conda installation has some architecture-specific libraries that are necessary for proper performance on the computer system we have. If the user performs the standard conda create... everything is installed from scratch, the user cannot get the correct library.

Solution

It sounds like you want to clone a basic Conda environment. You only need to use the --clone parameter in the create command. See the documentation link below

https://conda.io/docs/user-guide/tasks/manage-environments.html#cloning-an-environment

Related Problems and Solutions