Detailed installation instructions

Pyrocko can be installed under any operating system where its prerequisites are available. This document describes details about its requirements which are needed when a standard install is not possible or conflicts arise.

For standard install instructions, head on over to

Prerequisites

The following software packages must be installed before Pyrocko can be installed from source:

  • Build requirements
    • C compiler (tested with gcc, clang and MSVC)

    • patch utility

    • NumPy (>= 1.6, with development headers)

    • wheel

  • Try to use normal system packages for these Python modules:
  • Optional Python modules:
  • Manually install these optional software tools:

Download, build and install from source

The following examples will install Pyrocko from source, on Linux or MacOS. For Windows “from source” installs, please refer to Installation on Windows: From source.

Because of the many different and conflicting ways how you can manage your Python installations, be sure to understand the basics of Python package management before proceeding.

For convenience, we are using Pyrocko’s “from source” installation helper install.py here. Run python install.py --help for more information. The native commands to be run are printed before execution, and have to be confirmed by you.

(A1) Download (clone) the Pyrocko project directory with git:

cd ~/src/   # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko

(A2) Change to the Pyrocko project directory:

cd ~/src/pyrocko/

(A3) Install prerequisites using your method of choice:

# (a) If you manage the prerequisites with the system's native package manager:
python3 install.py deps system

# or (b), if you manage the prerequisites with pip:
python3 install.py deps pip

# or (c), if you manage your installation with conda:
python3 install.py deps conda

(A4) Build and install Pyrocko:

# If you want to install for single user (pip, venv, conda):
python3 install.py user

# or, if you want to install system wide:
python3 install.py system

Note: With pip, if you do not specify --no-deps, it will automatically download and install missing dependencies. Unless you manage your installations exclusively with pip, omitting this flag can lead to conflicts.

Note: The intention of using --no-build-isolation is to compile exactly against the already installed prerequisites. If you omit the flag, pip will compile against possibly newer versions which it downloads and installs into a temporary, isolated environment.

Note: If you have previously installed Pyrocko using other tools like e.g. pip, or conda, you should first remove the old installation. Otherwise you will end up with two parallel installations which will cause trouble.

Updating a “from source” install

If you later would like to update Pyrocko, run the following commands (this assumes that you have used git to download Pyrocko).

(B1) Change to the Pyrocko project directory (A2).

(B2) Update the project directory tree with git:

git pull origin master --ff-only

(B3) Build and reinstall Pyrocko (A4).

Uninstalling

You can use pip to uninstall Pyrocko:

# (a) To remove a single user "from source" install (pip, venv, conda):
pip uninstall pyrocko

# (b) To remove a system-wide "from source" install:
sudo pip uninstall pyrocko