Skip to content

Anaconda

Installing new software with Anaconda

Due to the shared nature of the existing Analytical Workbench, installing new software system-wide is not possible for users. However, it is possible to make use of virtual environments to enable users to install local versions of software that they can then use. As an example, we are going to use the conda environment and package management system to install a new version of R.

Please follow the previous instructions to make sure you have initialised your conda package manager correctly.

First create a new environment

Bash
conda create -n R3.6.2 python=3.7

this creates a new environment with the name R3.6.2 (or whichever name you choose), and installs a fresh copy of your selected Python version (in our case version 3.7).

In order to install new software, conda makes use of package "channels". These channels can be broad collections of more recent software (such as conda-forge) that hasn't made into the main conda repository, or be domain specific (e.g. bioconda or astroconda). In this example we will make use of the conda-forge channel and add it to our configuration file.

Bash
conda config –add channels conda-forge

then activate the environment

Bash
conda activate R3.6.2

Then install a new base version of R

Bash
conda install r-base=3.6.2

Make sure to include version numbers when it is important to have specific versions. This command will install the package selected, as well as all prerequisite software (dependencies).

Once done, this version of R can now be used in the command line. In order to use RStudio with this version, we must tell RStudio which R installation to use. This is done by exporting an environment variable, and then running rstudio from the command line to launch the GUI

Text Only
export RSTUDIO_WHICH_R=$(which R)
rstudio

This is only an example on updating the base version of R. It is also possible to install a variety of R packages and tools alongside this using the conda package manager. A good place to start learning conda is the conda docs, which contains tips, cheat sheets, and links to other resources.