{"id":8260,"library":"labmaze","title":"LabMaze","description":"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.","status":"active","version":"1.0.6","language":"en","source_language":"en","source_url":"https://github.com/google-deepmind/labmaze","tags":["maze-generation","deepmind","reinforcement-learning","environment","c++-bindings"],"install":[{"cmd":"pip install labmaze","lang":"bash","label":"Standard install for pre-built wheels"},{"cmd":"pip install bazel\n# Also install platform-specific build toolchain as per Bazel docs\npip install labmaze --no-binary :all:","lang":"bash","label":"Install from source (requires Bazel)"}],"dependencies":[{"reason":"Required for building from source (sdist) or when pre-built wheels are unavailable for your platform/Python version. LabMaze contains C++ code that needs compilation.","package":"bazel","optional":true},{"reason":"A common dependency for DeepMind Python libraries, often implicitly required due to C++ bindings using Abseil.","package":"absl-py","optional":false}],"imports":[{"symbol":"RandomMaze","correct":"from labmaze import RandomMaze"},{"symbol":"FixedMaze","correct":"from labmaze import FixedMaze"}],"quickstart":{"code":"import labmaze\n\n# Generate a random maze\nmaze = labmaze.RandomMaze(height=11, width=13, random_seed=42)\nprint(\"Random Maze Entity Layer:\")\nprint(maze.entity_layer)\n\n# Generate a maze from a fixed layout\n# 'P' for player spawn, 'G' for goal\nfixed_layout = \"\"\"\n###########\n#P . . . G#\n# . # . . #\n# . # . . #\n# . . . . #\n###########\n\"\"\"\nfixed_maze = labmaze.FixedMaze(\n    text_maze=fixed_layout,\n    num_spawns=1, # Can be overridden if 'P' tokens are present\n    num_objects=1 # Can be overridden if 'G' tokens are present\n)\nprint(\"\\nFixed Maze Entity Layer:\")\nprint(fixed_maze.entity_layer)","lang":"python","description":"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."},"warnings":[{"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.","message":"Support for Python 2.7 was dropped around version 1.0.4. Ensure you are using Python 3.6 or newer.","severity":"breaking","affected_versions":"<=1.0.3"},{"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.","message":"Installing `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).","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Newer 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`.","severity":"breaking","affected_versions":">=1.0.6 on Python 3.13+ with Bazel 8+"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"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.","cause":"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.","error":"ERROR: Failed building wheel for labmaze"},{"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.","cause":"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.","error":"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?"}]}