Registry / ai-ml / labmaze

labmaze

JSON →
library1.0.6pypypi✓ verified 85d ago

LabMaze is a standalone release of the maze generator used by DeepMind Lab, providing Python bindings to its C++ core. It can be configured to simplify paths and create rooms, and includes art assets to texture the environment. The primary purpose is to generate maze layouts for navigation tasks within other libraries. The current version is 1.0.6, released on December 5, 2022, indicating an infrequent release cadence focused on compatibility and bug fixes rather than new features.

pip install labmaze
INSTALL
IMPORT
SIG · LABMAZE
L
labmaze
ai-mlpythonv1.0.6
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ timeout
4/8 runs
py 3.11
✕ no_wheel
4/8 runs
py 3.12
✕ no_wheel
4/8 runs
py 3.13
✕ no_wheel
✕ no_wheel
py 3.9
✕ timeout
4/8 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RandomMaze
from labmaze import RandomMaze
FixedMaze
from labmaze import FixedMaze

This quickstart demonstrates how to create both random and fixed-layout mazes using `labmaze`. `RandomMaze` generates a maze with specified dimensions and a random seed. `FixedMaze` allows you to define a maze layout using a string, where 'P' denotes player spawn points and 'G' denotes goal positions. The `entity_layer` attribute provides a text representation of the generated maze.

import labmaze # Generate a random maze maze = labmaze.RandomMaze(height=11, width=13, random_seed=42) print("Random Maze Entity Layer:") print(maze.entity_layer) # Generate a maze from a fixed layout # 'P' for player spawn, 'G' for goal fixed_layout = """ ########### #P . . . G# # . # . . # # . # . . # # . . . . # ########### """ fixed_maze = labmaze.FixedMaze( text_maze=fixed_layout, num_spawns=1, # Can be overridden if 'P' tokens are present num_objects=1 # Can be overridden if 'G' tokens are present ) print("\nFixed Maze Entity Layer:") print(fixed_maze.entity_layer)
Debug
Known issues
breakingSupport for Python 2.7 was dropped around version 1.0.4. Ensure you are using Python 3.6 or newer.
fix
Upgrade to Python 3.6 or a later supported version. LabMaze currently supports Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12 via pre-built wheels.
affects: <=1.0.3
gotchaInstalling `labmaze` from a source distribution (sdist) or on unsupported platforms/Python versions requires Bazel and a correctly configured C++ build toolchain. Pre-built wheels are only provided for specific Python versions (3.6-3.12) and OS/architectures (x64 Linux, macOS, Windows).
fix
For standard environments, `pip install labmaze` usually works. If installation fails, ensure Bazel is installed and configured for your system, or try to use a Python version for which pre-built wheels are available.
affects: All versions
breakingNewer versions of Python (e.g., 3.13) combined with Bazel 8+ might lead to build failures during installation. This is due to changes in Bazel's handling of `WORKSPACE` files, causing issues with resolving internal dependencies like `bazel_skylib`.
fix
As a workaround, consider downgrading your Python version to a known compatible one (e.g., Python 3.10). A long-term fix would require an update to `labmaze`'s build configuration to support newer Bazel versions.
affects: >=1.0.6 on Python 3.13+ with Bazel 8+
Errors
Common errors & fixes
ERROR: Failed building wheel for labmaze
The most common cause is missing Bazel or an improperly configured build environment when `pip` attempts to compile the C++ source code, often because a pre-built wheel isn't available for your specific Python/OS/architecture. Errors like `command 'bazel' failed with exit status 1` or `error loading package '@com_google_absl//absl/strings'` are indicative.
fix
First, try `pip install labmaze`. If it fails, ensure you have Bazel installed and that your system's C++ build toolchain is set up correctly (e.g., XCode command line tools on macOS, Build Tools for Visual Studio on Windows, `build-essential` on Linux). For specific Python/Bazel versions, refer to the 'breaking' warnings.
ERROR: Skipping '//labmaze/cc/python:_defaults': error loading package 'labmaze/cc/python': at .../bazel/build_defs.bzl:18:6: Unable to find package for @@[unknown repo 'bazel_skylib' requested from @@]//lib:collections.bzl: The repository '@@[unknown repo 'bazel_skylib' requested from @@]' could not be resolved: No repository visible as '@bazel_skylib' from main repository. Was the repository introduced in WORKSPACE?
This error points to an incompatibility with newer Bazel versions (e.g., Bazel 8 and above) which have changed the default behavior and deprecation of `WORKSPACE` files, impacting how `labmaze` resolves its Bazel dependencies. This is often observed with Python 3.13 and later.
fix
Downgrade your Python environment to a version known to be compatible with `labmaze`'s current build system (e.g., Python 3.10 or 3.11). Alternatively, if possible, check the `labmaze` GitHub repository for updates or workarounds for newer Bazel versions.
Upgrade
Version history
1.0.6latest on PyPI · released Dec 5, 2022
Audit
Dependencies
bazeloptionalRequired for building from source (sdist) or when pre-built wheels are unavailable for your platform/Python version. LabMaze contains C++ code that needs compilation.
absl-pyrequiredA common dependency for DeepMind Python libraries, often implicitly required due to C++ bindings using Abseil.
Agent activity
10 hits · last 30 days
node
10
Resources
labmaze — pip install labmaze · libregistry