Creating custom channels¶
Channels are the path that conda takes to look for packages. The easiest way to use and manage custom channels is to use a private or public repository on Anaconda.org, formerly known as Binstar.org. If you designate your Anaconda.org repository as private, then only you and those you grant access can access your private repository.
If you do not wish to upload your packages to the Internet, you
can build a custom repository served either through a web server
or locally using a
To create a custom channel:
If you have not yet used conda build, install conda build:
conda install conda-build
Organize all the packages in subdirectories for the platforms you wish to serve:
channel/ linux-64/ package-1.0-0.tar.bz2 linux-32/ package-1.0-0.tar.bz2 osx-64/ package-1.0-0.tar.bz2 win-64/ package-1.0-0.tar.bz2 win-32/ package-1.0-0.tar.bz2
conda indexon the channel root directory:
conda index channel/
The conda index command generates a file
repodata.json, saved to each repository directory, which conda uses to get the metadata for the packages in the channel.
Each time you add or modify a package in the channel, you must rerun
conda indexfor conda to see the update.
To test custom channels, serve the custom channel using a web server or using a
file:// urlto the channel directory. Test by sending a search command to the custom channel.
EXAMPLE: If you want a file in the custom channel location
/opt/channel/linux-64/, search for files in that location:
conda search -c file://opt/channel/ --override-channels
The channel URL does not include the platform, as conda automatically detects and adds the platform.
--override-channelsensures that conda searches only your specified channel and no other channels, such as default channels or any other channels you may have listed in your
If you have set up your private repository correctly, you get the following output:
Fetching package metadata: . . . .
This is followed by a list of the conda packages found. This verifies that you have set up and indexed your private repository successfully.