VIRL2 (CML) Client Library
raw JSON → 2.9.1 verified Fri May 01 auth: no python
The official Cisco VIRL2 / Cisco Modeling Labs (CML) client library for Python. Provides programmatic access to CML 2.x instances, supporting lab lifecycle management, node configuration, and system administration. Current version 2.9.1 (released 2025-01-06). Release cadence follows CML versions approximately twice a year.
pip install virl2-client Common errors
error ModuleNotFoundError: No module named 'virl2_client' ↓
cause The package is installed under the name 'virl2-client' (with hyphen) and the import uses an underscore.
fix
pip install virl2-client
Then import using: from virl2_client import ...
error virl2_client.exceptions.CML2InternalError: This CML version does not support WebSocket connections. ↓
cause WebSocket functionality was added in CML 2.6.0. Older CML versions do not support it.
fix
Check your CML server version. Upgrade to CML 2.6.0 or later, or avoid WebSocket features.
Warnings
breaking From v2.7.0, the offline/local lab functionality is deprecated and will be removed in a future release. Do not rely on it for new projects. ↓
fix Use only controller-managed labs. If you need offline functionality, consider exporting/importing lab files manually.
gotcha SSL verification defaults to True. If your CML controller uses a self-signed certificate, you must pass ssl_verify=False or provide a CA bundle. ↓
fix client = CMLClient(url, username, password, ssl_verify=False)
Imports
- CMLClient
from virl2_client import CMLClient - ClientLibrary wrong
from virl2_client import ClientLibrarycorrectInternal server error