Can you export a created python conda environment for others to activate on their machines?

Viewed 8163

I do the following:

conda create -n myenv -c conda-forge jupyter xarray cmocean numpy matplotlib netCDF4 cartopy pandas

conda activate myenv

jupyter notebook

Is there a way that I can export this environment to another computer to be activated by another user?

I want other users to run my jupyter notebook script without having to install python packages.

3 Answers

Yes you can:

conda activate ENV
conda env export | grep -v "^prefix: " > environment.yml

The grep command removes your prefix. That yml file can be used by others as

 conda env create -f environment.yml
 conda activate ENV

You can copy the complete folder of the environment. It can be found easily, where your python is installed.

Related