Skip to content

Installation

System Requirements

  • Python 3.11–3.14
  • Linux (x86-64), macOS 14 or newer (Apple Silicon), or Windows (x86-64) — the package installs anywhere, but solve() raises UnsupportedPlatformError on other platforms (e.g. Intel Macs)
  • Docker (only required for tqrouting[osrm-local])

On Linux the solver links two system libraries: libcurl.so.4, which verifies the license against your machine's CA store, and the OpenMP runtime libgomp.so.1, which runs the parallel search. Standard distributions ship both; minimal container images may need them installed:

apt-get install -y libcurl4 libgomp1    # Debian/Ubuntu
dnf install -y libcurl libgomp          # RHEL/Fedora

macOS and Windows need no system libraries.

Basic Install

TQrouting is distributed from Terra Quantum's package index:

pip install tqrouting --extra-index-url https://europe-python.pkg.dev/bright-primacy-486519-b9/tq-public/simple

This installs the core package with no optional dependencies.

To avoid repeating the flag, register the index once — every later pip install tqrouting[...] in that environment then finds it automatically:

export PIP_EXTRA_INDEX_URL=https://europe-python.pkg.dev/bright-primacy-486519-b9/tq-public/simple
--extra-index-url https://europe-python.pkg.dev/bright-primacy-486519-b9/tq-public/simple
tqrouting

Optional Extras

TQrouting provides optional integrations for computing distance/duration matrices from geographic coordinates. The commands below assume the index is registered as shown above.

# OSRM support (remote server)
pip install tqrouting[osrm]

# OSRM local Docker manager (auto-downloads maps and runs a local server)
pip install tqrouting[osrm-local]

# Google Maps Routes API
pip install tqrouting[google]

# All matrix providers
pip install tqrouting[all]

See Distance & Duration Matrices for details on how each matrix provider works and when to use which.

License Key

TQrouting requires a license key. Set it via environment variable or pass it directly:

export TQROUTING_LICENSE_KEY="..."
$env:TQROUTING_LICENSE_KEY = "..."
setx TQROUTING_LICENSE_KEY "..."
from tqrouting import TQRouter

router = TQRouter(license_key="...")

Tip

Setting the environment variable is recommended for production. The library automatically picks it up — no code changes needed.

Verifying the Installation

Run a tiny end-to-end solve — it exercises both the platform binary and the license check, so it fails if either is missing:

from tqrouting import TQRouter, VRPInstance, Customer, VehicleType, Location

router = TQRouter()

instance = VRPInstance(
    customers=[
        Customer(location=Location(matrix_id=1), delivery_load=1),
        Customer(location=Location(matrix_id=2), delivery_load=1),
    ],
    fleet=[
        VehicleType(
            start_location=Location(matrix_id=0),
            end_location=Location(matrix_id=0),
            capacity_load=2,
            n_vehicles=1,
        ),
    ],
    distance_matrix=[
        [0, 1, 2],
        [1, 0, 1],
        [2, 1, 0],
    ],
)

solution = router.solve(instance, time_limit=1)
print(f"TQrouting is ready! ({len(solution.routes)} route, duration {solution.total_route_duration})")

Expected output:

TQrouting is ready! (1 route, duration 4.0)

If the license key is missing or invalid, solve() raises a LicenseError — see License Key above.