Date

Conda is a general package and virtual environment manager. There is a cheat-sheet here.

Installation (Linux)

To install do:

wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
chmod 777 Miniconda2-latest-Linux-x86_64.sh
./Miniconda2-latest-Linux-x86_64.sh

Accept the installer defaults and agree to updating your ~/.bashrc script. You will need to restart the shell (or source ~/.bashrc) before proceeding. Do:

conda update conda

to update to the latest version. To create an environment (which needs a default package) do:

conda create -n env_name python

I then had to manually install psutil (maybe a bug?):

conda install psutil

To acitvate and deactivate do (linux):

source activate env_name
source deactivate

Adding Packages

To install packages do:

conda install $PACKAGE_NAME

If a package is not on the repo it might be on someone elses ‘channel’. To add a custom channel do:

conda config --add channels $CHANNEL_NAME

To install from a specific channel do:

conda install -c $CHANNEL_NAME $PACKAGE_NAME

To uninstall everything do:

rm -rf ~/miniconda

Building Conda Packages

This requires conda build:

conda install conda-build

Make a ‘build’ folder with the package name and add a metadata file meta.yaml and a built script build.sh.

mkdir $MY_PACKAGE
cd $MY_PACKAGE
touch meta.yaml build.sh

The metadata and build files need to be populated (http://conda.pydata.org/docs/building/build.html). To build the package do:

conda build .

To upload the package to Anaconda.org first install anaconda-client, log into your account and then upload.

conda install anaconda-client
anaconda login
anaconda upload path-to-package.zip

Troubleshooting

Some things that have gone awry:

Other Notes

  • conda-forge is a useful channel with some more up-to-date packages than the official repo.

Comments

comments powered by Disqus