Install & Compatibility
Where this runs
tested against v26.5 · 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
py 3.11
✕ build_error
✓ 34.18s
py 3.12
✕ build_error
✓ 36.55s
py 3.13
✕ build_error
✓ 35.2s
685MB installed
● package 685MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Testbed
✓ from genie import Testbed
✗ from genie.libs.sdk import Testbed
This quickstart demonstrates how to set up a basic testbed YAML, load it using `pyats.topology.Testbed`, and access a device object. It uses environment variables for credentials to keep the example runnable without exposing sensitive data. Note that methods like `device.connect()` and `device.parse()` require an actual network device connection to function, which is omitted for a fully runnable, non-network-dependent example.
import os
from pyats.topology import Testbed
# Create a dummy testbed YAML file for the example
testbed_content = """
devices:
router1:
os: iosxe
type: router
connections:
cli:
protocol: ssh
ip: 127.0.0.1
port: 22
credentials:
default:
username: {}
password: {}
""".format(os.environ.get('GENIE_DEVICE_USERNAME', 'cisco'),
os.environ.get('GENIE_DEVICE_PASSWORD', 'cisco'))
testbed_path = "temp_genie_testbed.yaml"
with open(testbed_path, "w") as f:
f.write(testbed_content)
try:
# Load the testbed using pyATS
testbed = Testbed(testbed_path)
print(f"Successfully loaded testbed from {testbed_path}")
# Access a device defined in the testbed
device = testbed.devices['router1']
print(f"Accessed device: {device.name}")
print(f"Device OS: {device.os}")
print(f"Device Type: {device.type}")
# To perform actual operations (like device.parse() or device.connect()),
# a live connection to a network device is required.
# Example (will fail without connection, for demonstration only):
# try:
# device.connect()
# output = device.parse('show version')
# print(f"Parsed 'show version': {output.keys()}")
# finally:
# if device.is_connected():
# device.disconnect()
except Exception as e:
print(f"An error occurred: {e}")
finally:
# Clean up the dummy testbed file
if os.path.exists(testbed_path):
os.remove(testbed_path)
genie --version
Debug
Known issues
breakingGenie is tightly coupled with pyATS. Mismatched versions between `genie` and `pyats` core packages are a frequent cause of `ImportError`, `AttributeError`, or unexpected behavior.fixAlways install `genie` and `pyats` together or ensure their versions are compatible as specified in the official pyATS release notes. `pip install pyats genie` will often install compatible versions.
affects: All versions, especially across major pyATS/Genie releases (e.g., pyATS 23.x with Genie 23.x, pyATS 24.x with Genie 24.x).
gotchaPython version compatibility. Genie (and pyATS) strictly enforce minimum Python versions. Using an unsupported Python version will lead to installation failures or runtime errors.fixEnsure your Python environment meets the `requires_python` specification from PyPI, currently `>=3.8` for Genie 26.x.
affects: All versions, especially when upgrading Python environments.
breakingGenie Ops (`device.parse()`) and Conf (`device.configure()`) output/input structures can change between major releases. This can break existing automation scripts that rely on specific keys or nested data structures.fixConsult the release notes for Genie and pyATS for changes in Ops/Conf models. Update your scripts to reflect the new data structures. Consider using `pip install --upgrade pyats genie` for minor updates, but carefully review changes for major updates.
affects: Major Genie releases (e.g., 23.x to 24.x, 24.x to 25.x).
gotchaTestbed YAML schema can evolve. Using an outdated or malformed testbed YAML file with a newer version of pyATS/Genie can lead to schema validation errors.fixRefer to the latest pyATS documentation for the current testbed YAML schema. Use `pyats parse testbed <your_testbed.yaml>` to validate your testbed file.
affects: All versions.
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pyatsrequiredGenie is built on the pyATS framework and requires a compatible pyATS core installation.