Skip to content
Advertisement

How to create a conda environment with specified libraires?

When creating a new conda environment, some packages are installed by default.

> conda create -n newEnv python=3.6

The following NEW packages will be INSTALLED:

     openssl:    1.0.2k-1
     pip:        9.0.1-py36_1
     python:     3.6.1-0 
     ...
     zlib:       1.2.8-3

I believe there is a way to specify the default libraries to install when creating a new environment without having to type all the names after the conda create command.

Is there any file I can edit so as to specify which are the default libraries to install when creating a new environment with conda?

Solution : Based on holdenweb answer below, you need to add the following line in your .condarc (doesn’t exist by default) :

create_default_packages:
     - jupyter
     - matplotlib
     - otherLibrary
     ...

This is a list of libraries that will be installed when creating a new environment. You can also add libraries directly by using the following command (using jupyter as an example)

conda config --add create_default_packages jupyter

which will append the specified library (here jupyter) to the list above.

Advertisement

Answer

Perhaps you are looking for the create_default_packages option? You can specify a list of default packages using this directive in your .condarc file. It’s documented on this page. You can override it with the --no-default-packages command-line option.

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