Using Conda with Anaconda Server

Configuration

You will need to configure Conda to install packages from your Anaconda Server installation.

  1. Set your channel alias on conda:
  • If you are using SSL:

    # Replace <DOMAIN> with your domain.
    conda config --set channel_alias https://<DOMAIN>/api/repo
    
  • If you are not using SSL:

    # Replace <DOMAIN> with your domain.
    conda config --set channel_alias http://<DOMAIN>/api/repo
    

And configure your default channels to include the channel where Anaconda Distribution packages have been mirrored:

# Replace <DEFAULT_CHANNEL> with the channel where Anaconda Distribution packages have been mirrored.
conda config --prepend default_channels <DEFAULT_CHANNEL>

You can run the above command multiple times to configure several default channels.

Manual Configuration

Alternatively, you can edit your .condarc file manually:

You will need to configure your conda configuration file, .condarc, to point to your instance of Anaconda Server and set up the channel(s) you want to pull packages from. This enables Conda to install packages from your instance of Anaconda Server rather than pulling from repo.anaconda.com.

The location of your .condarc file depends on which operating system you use. Consult the condarc documentation to determine the correct path.

  1. Open the .condarc file with a text editor

  2. Set the channel_alias and the default_channels

    channel_alias: https://<HOST_NAME>.<COMPANY>.com/api/repo
    
    default_channels:
      - <DEFAULT_CHANNEL>
    
  3. Save the file.

Installing packages

Install packages from Anaconda Server (public channels):

conda install [-c <CHANNEL_NAME>] <PACKAGE_NAME>

The -c <CHANNEL_NAME> flag allows you to install packages from channels on Anaconda Server that have been created by users or administrators.

If you do not specify the -c flag, packages will be taken from the channels in the default_channels configuration.

Note

Prior to installing packages from a private or authenticated channel, you first need to log in using the Anaconda Server CLI, not from the browser.

Conda Reference

More information on conda commands can be found in the conda documentation.