Skip to content

Setup Conda tutorial#

Setup course material#

Follow the instructions below only if you start the course at this stage! Otherwise skip this step!
This tutorial depends on files from the course GitHub repo. Please follow these instructions 
on how to set it up if you haven't done so already.  
Let's create a directory and clone the course GitHub repo.
```bash
mkdir -p  ~/training-reproducible-research-area
cd ~/training-reproducible-research-area
git clone https://github.com/SouthGreenPlatform/training_reproducible_research
```

Setup environment#

First let's create a dedicated folder for this tutorial:

mkdir -p  ~/training-reproducible-research-area/conda
cd ~/training-reproducible-research-area/conda
cp -r ~/training-reproducible-research-area/training_reproducible_research/tutorials/conda/* . 

Installing Conda#

Conda is installed by downloading and executing an installer from the Conda website, but which version you need depends on your operating system. Choose the appropriate installer from the list you can found here: https://docs.conda.io/en/latest/miniconda.html. Then copy the link and download the installer on your computer, see example below:

# Install Miniconda3 for 64-bit Linux
curl -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O

Warning

If you already have installed Conda but want to update, you should be able to simply run conda update conda and subsequently conda init, and skip the installation instructions below.

Now you can execute the installer:

bash Miniconda3-latest-Linux-x86_64.sh

The installer will ask you questions during the installation:

  • Do you accept the license terms?
    • Yes
  • Do you accept the installation path or do you want to choose a different one?
    • Yes
  • Do you want to run conda init to setup Conda on your system?
    • Yes

Restart your shell so that the settings in ~/.bashrc or ~/.bash_profile can take effect. You can verify that the installation worked by running:

conda --version

You can now get rid of the installer, you don't need it anymore

rm Miniconda3-latest-Linux-x86_64.sh

By default conda will be activated to every new terminal you will open (in the base environment). If you whish to deactivate this behaviour run:

conda config --set auto_activate_base false

Different Condas

There are three Conda-related things you may have encountered: the first is Conda, the package and environment manager we've been talking about so far. Second is Miniconda, which is the installer for Conda. The third is Anaconda, which is a distribution of not only Conda, but also over 150 scientific Python packages. It's generally better to stick with only Conda, i.e. installing with Miniconda, rather than installing 3 GB worth of packages you may not even use.

Lastly, we will setup the default channels (from where packages will be searched for and downloaded if no channel is specified).

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict