conda
package manager is used in the Anaconda Python Distribution and Miniconda. Here are some commands that I use a lot.
By default, conda env export
will show the full path prefix of your environment, which is not portable across machines, e.g.:
prefix: /home/olga/anaconda3/envs/tabula-muris-env
To export without a prefix use head
to remove the last two lines of the file (prefix plus empty line)
conda env export -p | head -n -2 > environment.yml
An excerpt of the output is below:
- r-zoo=1.8_0=mro343h086d26f_0
- readline=7.0=ha6073c6_4
- rstudio=1.1.383=h2c9cdda_2
- scipy=1.0.0=py35hcbbe4a2_0
- seaborn=0.8.1=py35h04cba02_0
- send2trash=1.5.0=py35_0
Sometimes you don't want the versions either. Then you need to slice the file on the equals sign =
:
conda env export | head -n -2 | cut -f 1 -d '=' > environment.yml