Installation

There are several ways to install Pyrocko. Choose one of them and stick to it. Mixing installation methods for the same Python, e.g. apt and pip, or conda and pip, is the most common cause of installation problems (see Avoid mixing package managers below).

Which way to choose:

Quick installation for trying out Pyrocko

To just try out Pyrocko under Linux or macOS, without touching the rest of your system, run in a bash or zsh terminal:

source <(curl -fsSL https://pyrocko.org/pvc_init) && pvc install

This installs the latest release of Pyrocko from PyPI into a virtual environment in ~/.pyrocko/venv. Afterwards, run pvc activate to use it in a terminal, or pvc for help. It needs Python 3.10 or newer, with the venv module (on Debian and Ubuntu, install the package python3-venv).

Avoid mixing package managers

apt, pip and conda (and others, like uv) each manage their own copies of Python packages. If more than one of them installs the same package, e.g. NumPy, for the same Python, the copies shadow each other, and which one is used depends on details. The resulting errors are hard to understand. Some rules of thumb:

  • Use pip only inside a virtual environment, and never with sudo.

  • In a conda environment, install everything with conda. The only exception is installing Pyrocko itself from source, see Installation with conda.

  • If you have installed Pyrocko with apt, do not install it with pip as well.

To find out which Python you are using, run:

which python python3

It shows the path of the python and python3 commands your terminal runs (on Windows, use where python). In an activated virtual environment, they should point into the virtual environment’s directory, e.g. ~/venv/pyrocko/bin/python; in a conda environment, into the conda environment’s directory. If not, the environment is not active, or the commands come from somewhere else.

To find out which Pyrocko you are using, run:

pyrocko info

It shows the Python executable, the paths where Python looks for packages and the Pyrocko installations found there. If it lists more than one, the one marked as used shadows the others: remove those you don’t need. Please include this output when you ask for help.

If the pyrocko command is not found, check with the same Python you use for your work:

python3 -c "import pyrocko, sys; print(pyrocko.__version__, pyrocko.__file__, sys.executable)"

Support

If you run into problems during installation, please let us know via Pyrocko Issues or join our support forum.