Strike.py, Grids.py, Bouguer.py and Gmodel.py are desktop applications written in Python. They share the same set of dependencies and can be run on any computer — macOS, Windows or Linux — once those dependencies are installed. No installer is required; the programs are plain Python script files that are launched directly from the command line.
This guide walks through every step: installing Python, installing the required packages, copying the program files, and starting the programs.
| Requirement | Minimum version | Notes |
|---|---|---|
| Python | 3.8 | 3.9 or newer recommended. Python 2 is not supported |
| PyQt5 | 5.12 | The graphical user-interface toolkit |
| NumPy | 1.20 | Array mathematics |
| Matplotlib | 3.4 | Plotting library; the Qt5Agg back-end is used automatically when PyQt5 is present |
| SciPy | 1.6 | Used by Strike.py and Grids.py for least-squares fitting (scipy.linalg.lstsq). Not required by Gmodel.py or Bouguer.py |
All other modules used by the programs (math, os, sys, struct, pathlib, argparse, traceback) are part of the Python standard library and do not need to be installed separately.
If Python 3.8 or newer is already installed you can skip to Step 2. To check, open a terminal (or Command Prompt on Windows) and type:
python3 --version
If you see Python 3.x.x with x ≥ 8 you are ready. If you see Python 2.x.x, or the command is not found, install a current Python 3 release.
Download the macOS installer from python.org/downloads and run it. Alternatively, if you have Homebrew installed:
brew install python
Download the installer from python.org/downloads. During installation, tick the option "Add Python to PATH" before clicking Install. This is required so that python and pip commands work from any folder in Command Prompt.
Use the package manager for your distribution:
# Debian / Ubuntu
sudo apt update
sudo apt install python3 python3-pip python3-venv
# Fedora / RHEL
sudo dnf install python3 python3-pip
The four packages (PyQt5, NumPy, Matplotlib, SciPy) are all available from PyPI and can be installed with a single pip command.
A virtual environment keeps these packages separate from the rest of the system and avoids version conflicts with other Python projects. This is optional but strongly recommended.
# Create a virtual environment called "strikeenv" (any name will do)
python3 -m venv strikeenv
# Activate it — macOS / Linux
source strikeenv/bin/activate
# Activate it — Windows (Command Prompt)
strikeenv\Scripts\activate.bat
# Activate it — Windows (PowerShell)
strikeenv\Scripts\Activate.ps1
Once the environment is active, your terminal prompt will show its name in parentheses, e.g. (strikeenv). All packages installed from this point on go into that environment and do not affect the rest of the system.
pip install PyQt5 numpy matplotlib scipy
pip will download and install the packages and all their own dependencies automatically. The download is typically 150–250 MB. A working internet connection is required.
sudo apt install python3-pyqt5 # Debian / Ubuntu
sudo dnf install python3-qt5 # Fedora
Copy the Python script files to any convenient folder on the new computer. They are self-contained and do not require installation; placing them in one folder is sufficient.
| File | Program |
|---|---|
Strike.py | Directional spectral analysis of geophysical grids |
Grids.py | Grid preparation — clipping, kriging, trend removal, arithmetic |
Bouguer.py | Bouguer anomaly calculations and fractal analysis |
Gmodel.py | Interactive 2-D gravity modelling and inversion |
The four programs are independent. You do not need all four — copy only those you intend to use.
Open a terminal, navigate to the folder containing the scripts, and run:
python3 Strike.py
python3 Grids.py
python3 Bouguer.py
python3 Gmodel.py
On Windows, python3 may be called python (without the 3):
python Strike.py
If you used a virtual environment (Step 2), make sure it is activated before running the programs — otherwise Python will not find the installed packages.
You can create a small shell script to double-click instead of using the terminal. Open TextEdit, switch to plain-text mode, and save the following as RunStrike.command (or similar) in the same folder as the Python files:
#!/bin/bash
cd "$(dirname "$0")"
python3 Strike.py
Then make it executable:
chmod +x RunStrike.command
Double-clicking RunStrike.command will open a terminal window and launch the program.
If Python was installed with the Add to PATH option ticked, you can right-click the Strike.py file, choose Open with → Python, and the program will start. Alternatively, create a shortcut whose target is:
python "C:\path\to\Strike.py"
Before launching a full program, you can confirm that all packages are installed correctly by running the following one-liner in the terminal:
python3 -c "import PyQt5, numpy, matplotlib, scipy; print('All packages OK')"
If the message All packages OK appears, the environment is ready. If you see a ModuleNotFoundError, the named package was not installed — re-run the pip install command from Step 2.
| Symptom | Likely cause and fix |
|---|---|
ModuleNotFoundError: No module named 'PyQt5' |
PyQt5 was not installed, or the wrong Python interpreter is being used. Run pip install PyQt5 (with the virtual environment active, if you used one) |
ModuleNotFoundError: No module named 'numpy' (or matplotlib, scipy) |
Run pip install numpy matplotlib scipy |
| Window appears but is blank, or crashes on startup with a Qt platform error | On Linux, Qt needs a display. Make sure you are running in a graphical desktop session, not a headless SSH shell. If connecting remotely, use SSH with X11 forwarding (ssh -X …) |
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" (Linux) |
Install the missing system library: sudo apt install libxcb-xinerama0 |
| Program opens but plots are empty or the matplotlib canvas is grey | The Qt5Agg back-end may not be loading. Ensure that PyQt5 and matplotlib were installed in the same Python environment |
python3: command not found (Windows) |
Python is not on the PATH. Either re-run the Python installer and tick "Add Python to PATH", or use the full path, e.g. C:\Python312\python.exe Strike.py |
| Very slow startup on first run (macOS) | macOS Gatekeeper may be checking the unsigned scripts. This delay happens only once; subsequent launches are fast |
# 1. Check Python version
python3 --version
# 2a. Create and activate a virtual environment (recommended)
python3 -m venv strikeenv
source strikeenv/bin/activate # macOS / Linux
strikeenv\Scripts\activate.bat # Windows Command Prompt
# 2b. Install all required packages
pip install PyQt5 numpy matplotlib scipy
# 3. Verify
python3 -c "import PyQt5, numpy, matplotlib, scipy; print('All packages OK')"
# 4. Run the programs
python3 Strike.py
python3 Grids.py
python3 Bouguer.py
python3 Gmodel.py