Installation under Linux

This page describes the most common ways to install Pyrocko under Linux. Pick the one that fits your situation:

Your situation

Way to install

Debian or Ubuntu

Prebuilt packages from our apt repository

Any distribution (recommended)

pip in a virtual environment, prerequisites from the system

No suitable system packages,
or no permission to install them

pip in an isolated virtual environment

Working on Pyrocko itself,
or need a special branch

Installation from source

Conda user

Installation with conda

Alternative: pip in an isolated virtual environment

If suitable system packages for the prerequisites are not available, e.g. on an older distribution or on a system where you cannot install packages, pip can install all prerequisites into the virtual environment as well. The virtual environment is then isolated: it doesn’t use any of the system’s Python packages, only the Python interpreter itself.

python3 -m venv ~/venv/pyrocko
source ~/venv/pyrocko/bin/activate
pip install "pyrocko[gui]"

The [gui] part also installs the prerequisites of the GUI applications (PyQt5 and VTK); leave it out if you don’t need them. On Debian and Ubuntu, the venv module needs the package python3-venv.

Activating, updating and removing work as described above. Compared to the recommended way, the isolated virtual environment needs more disk space, you have to update the prerequisites yourself (pip install --upgrade ...), and the GUI libraries from pip may integrate less well with the desktop than the system’s.

Installation from source, for development

To work on Pyrocko itself, or to use a specific branch, install it from source. The first three variants use Pyrocko’s install.py helper, which can also install the prerequisites with your system’s package manager. The last one installs a branch directly with pip.

System-wide

Any Linux
cd ~/src/   # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
cd pyrocko
python install.py deps system  # installs prerequisites using apt/yum/pacman
python install.py system       # installs Pyrocko with pip, but uses system deps

Into a virtual environment, prerequisites from pip

Any Linux
cd ~/src/   # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
cd pyrocko
python -m venv myenv
source myenv/bin/activate
pip install .                          # pip auto-resolves prerequisites (!)
pip install --only-binary :all: PyQt5 PyQtWebEngine # for Snuffler

Into a virtual environment, prerequisites from the system

Any Linux
cd ~/src/   # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
cd pyrocko
python -m venv --system-site-packages myenv
source myenv/bin/activate
python install.py deps system  # installs prerequisites using apt/yum/pacman
python install.py user         # installs Pyrocko with pip, but uses system deps

Directly from the repository with pip, without cloning

To try out a specific branch (or tag, or commit) without keeping a source checkout, pip can fetch and build it directly from the Git repository. Set up the prerequisites and the virtual environment as described in Recommended: pip in a virtual environment, prerequisites from the system, then, with the virtual environment activated:

Any Linux
pip install "git+https://git.pyrocko.org/pyrocko/pyrocko.git@BRANCH"

Replace BRANCH with the name of the branch, e.g. main. This needs git, a C compiler and the Python headers (e.g. on Debian/Ubuntu: sudo apt install git gcc python3-dev). To pick up new commits on the branch later, run the command again with --force-reinstall --no-deps added.

Distribution specific details and prerequisite package lists

For instructions on how to install Pyrocko on other systems or if the installation with any of the above procedures fails, see System specific installation instructions or Detailed installation instructions.