Source installation
This page explains how you can install G4X-helpers on your local machine. If you’re happy running the tool via Docker, you can skip these installation steps and head to the Docker setup section.
You only need a local install if you want to:
- use the
G4X-helpersCLI directly on your machine - use the package beyond the CLI features exposed in the Docker image
- develop or debug the codebase
- integrate pieces of the library into your own Python environment
If these use cases apply to you, please read on
Step 1: clone the G4X-helpers repository
navigate to the repo directory:
Note
All subsequent steps assume that you are in the G4X-helpers directory. You can confirm this in your terminal via pwd.
You should see a path ending in: /G4X-helpers.
Step 2: install the package
Note
G4X-helpers depends on Glymur and OpenJPEG >= 2.2.0 for multi-threaded image loading. On some systems, Glymur may require additional configuration to detect OpenJPEG.
Due to those limitations we strongly suggest installing OpenJPEG, and thus G4X-helpers, via conda, as it reliably provides compatible and properly linked dependencies across platforms.
Other installation methods (e.g., Homebrew or manual builds) may lead to issues such as Glymur reporting version 0.0.0 or failing to load JPEG 2000 (.jp2) images.
Create a conda environment
Install miniconda, conda, or mamba (instructions).
If this is your first time using conda:
Create the environment:
Activate the environment:
Install the package:
Install into your current python environment via pip
Warning
pip does not create or manage virtual environments, so installing through pip install . will require that your local Python version is compatible with the package dependencies (Python >= 3.10).
Step 3: Verify OpenJPEG installation
After installation of G4X-helpers, confirm that Glymur recognizes OpenJPEG via:
If your OpenJPEG is installed and was detected successfully, you can now proceed to use G4X-helpers.
If Glymur does not detect a compatible OpenJPEG version, please follow the steps below. If this happens, we strongly suggest performing the G4X-helpers installation and the following steps in a conda environment.
If the above installation was done using uv and Glymur failed to detect OpenJPEG, you will likely need to do the next steps with Homebrew, since conda installations are not visible to uv virtual environments.
Hints on other systems are provided, but not supported! You can find further details in the Glymur documentation on advanced installation methods.
Step 4: Install OpenJPEG
Install openjpeg through conda
Return to Step 3 to verify that Glymur detects OpenJPEG with a version >=2.2.0.
Install OpenJPEG and pkg-config
Create a Glymur config directory
Add the Homebrew installed OpenJPEG path to a glymurrc file in the config
Return to Step 3 to verify that Glymur detects OpenJPEG with a version >=2.2.0.
Step 5: Verify installation
To start using G4X-helpers, ensure that you have activated the environment in which the package was installed. If your installation of G4X-helpers was successful, the following commands should print help text:
g4x-helpers --helpg4x-helpers resegment --helpg4x-helpers redemux --helpg4x-helpers update_bin --helpg4x-helpers new_bin --helpg4x-helpers tar_viewer --helpg4x-helpers migrate --help
Tip
You can see the expected output of the --help statements in the CLI usage section.
⸻