KBI0020: Installing DataLad and dependencies in Google Colab#

authors:

Stephan Heunis <jsheunis@gmail.com>

discussion:

https://github.com/psychoinformatics-de/knowledge-base/pull/80

keywords:

Google Colab, Conda, installation```

software-versions:

datalad_0.18.4, git-annex_10.20230330-g98a3ba0ea, conda_23.3.1

Google Colaboratory allows anybody to write and execute arbitrary Python code through the browser. It is particularly useful if you don’t want to go through the process of installing particular software on your local machine or server.

This knowledge base item summarizes suggested steps for installing DataLad and all of its dependencies in a Google Colab notebook. This blog post was particularly helpful to identify these steps:

  • We suggest installation using conda, specifically via miniconda

  • First, miniconda can be installed into a notebook environment using a Linux installer script, provided here.

  • Then, the environment’s path variable has to be updated to include the location that conda installs packages into. This is necessary for Python to know where it can import available packages from.

  • Lastly, datalad can be installed via conda per the installation instructions.

An implementation of the above steps, with code and instructions, can be found in this Google Colab Notebook.

Note

For standard notebook usage on Google Collaboratory, the installed software and data only remain available during a single runtime session. If a notebook is restarted, the software would have to be re-installed.