Installation with pip¶
Pyrocko is available from the Python Package Index (PyPI), as prebuilt packages for Linux, macOS and Windows, and as source package for other platforms.
Always use pip inside a virtual environment (a directory with its own set
of Python packages). Don’t use pip with sudo, --user or
--break-system-packages: these install into your system’s or your user’s
Python, where pip’s packages get mixed up with those of the system’s package
manager (see Avoid mixing package managers).
There are two variants, depending on where the prerequisites (NumPy, SciPy, Qt, etc.) come from.
Variant 1: prerequisites from the system (recommended on Linux)¶
Install the prerequisites with your system’s package manager, create a virtual
environment with access to them (--system-site-packages) and let pip
install only Pyrocko itself. See Installation under Linux for the
package lists and the commands.
Variant 2: everything from pip¶
If suitable system packages are not available, pip can install all prerequisites, including those of the GUI applications, into the virtual environment:
python3 -m venv ~/venv/pyrocko
source ~/venv/pyrocko/bin/activate
pip install "pyrocko[gui]"
python -m venv %USERPROFILE%\venv\pyrocko
%USERPROFILE%\venv\pyrocko\Scripts\activate
pip install "pyrocko[gui]"
The virtual environment then contains its own copies of all prerequisites, independent of the system. It needs more disk space, and the GUI libraries from pip may integrate less well with the desktop than the system’s.
Using the virtual environment¶
Activate the virtual environment in every new terminal in which you want to use Pyrocko. Alternatively, start Pyrocko’s applications without activating, e.g.
~/venv/pyrocko/bin/snuffler.To update Pyrocko, activate the virtual environment and run
pip install --upgrade pyrocko.To remove it, simply delete the directory
~/venv/pyrocko.