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()raisesUnsupportedPlatformErroron 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:
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:
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:
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:
If the license key is missing or invalid, solve() raises a LicenseError — see License Key above.