Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export a conda environment? (command seems not to be working)

I would like to export a conda environment, so that I can use it on another PC. I found this: https://docs.anaconda.com/anaconda-cloud/user-guide/tasks/work-with-environments/

And used the command that is in there, in the command promt opened via the anaconda navigator as follows: conda env export --name root -f root.yml. No feedback was given, and the root.yml file seems nowhere to be found.

After looking on stackoverflow, I found the command conda env export > root.yml. However, still no feedback is given, and the root.yml file is also missing. Running only conda env export gives a list of the name, channels, dependencies, and prefix. However, still no yml file to export.

I have the following versions:

 conda version : 4.7.12
    conda-build version : 3.18.8
         python version : 3.7.3.final.0

Can anyone tell me what I am doing wrong?

like image 874
Emma van de Vreugde Avatar asked Sep 18 '25 14:09

Emma van de Vreugde


1 Answers

Try using this command:

conda list --name root --export > root-env.txt

This is one of the recommended methods for saving an environment spec. List the contents in a known format that conda can reuse (the --export flag) and then write to a file using the > operator.

The exported file will be in whatever directory you are running the command from. I.e. running:

C:\Users\hello>conda list --name root --export > root-env.txt

Will save the file to

C:\Users\hello\root-env.txt
like image 175
James Avatar answered Sep 21 '25 04:09

James