Dependencies 101
Dependencies are the versions of different packages/modules that your code depends on, for example the version of Python you are using, and any libraries you have to import, like matplotlib
, scipy
, tensorflow
etc.
Dependencies are an important thing to keep track of when building scientific code. How many different external libraries does your code depend on? What versions of these libraries does it need? How do you install and update these different libraries?
Launch fullscreen presentation ⤢
Package management for Python
In Python, there are lots of different ways to install and manage packages and dependencies. These different tools generally involve using virtual environments in order to keep the dependencies for different projects separate and tidy. Some package installation and management tools include:
You can read more about Python package management tool recommendations here. The package management tool you use will vary depending on whether you want to build your code into a package itself, or are relying primarily on external libraries. Some of these package managers include entire workflows for building and publishing Python packages, while others focus on organising pre-existing packages.
Package management for other coding languages
Note that I do not have as extensive experience managing projects, dependencies and packages in the following languages so please proceed with caution.
Package management in R
conda for R: you can install conda via Miniforge as linked above, and then install R packages through this following these instructions for R with conda.
renv: the reproducible environment package for R has some very nice introductory documentation.
Package management in Julia
Pkg: Pkg is Julia’s built-in package manager.
In research, a lot of people rely on conda
: you can read more about perfecting your conda environment in this blog post.
Citation
@online{murphy_quinlan2025,
author = {Murphy Quinlan, Maeve},
title = {Dependencies 101},
date = {2025-02-18},
url = {https://murphyqm.github.io/research-software-dev/managing-dependencies/dependencies-intro.html},
langid = {en}
}