ConfigSpace is a Python library designed to manage configuration spaces for automated algorithm configuration and hyperparameter optimization tasks. It provides a straightforward API for defining hyperparameters, their ranges, conditional dependencies, and forbidden clauses. ConfigSpace is frequently used in AutoML tools such as SMAC3, BOHB, and auto-sklearn. The current stable version is 1.2.2, released on December 19, 2025, and it maintains an active release cadence.
pip install ConfigSpaceVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a `ConfigurationSpace` object and add `Float` and `Integer` hyperparameters with defined ranges and default values. It then shows how to sample a single configuration from the space and access its values.
Instead of `q`, consider using `OrdinalHyperparameter` if discrete steps are strictly required, or rely on the distribution properties directly for numerical parameters. Check the `Hyperparameters` reference in the documentation.
Consult the official documentation for the updated API. Specifically, newer ways to define hyperparameters directly in `ConfigurationSpace` or via simple functions are preferred over direct type instantiation for common use cases.
Avoid direct equality or inclusion checks on float values in conditions. Consider using ranges or slightly adjusted bounds for comparisons if necessary, or refactor your conditions to use other hyperparameter types where precision is guaranteed.
Upgrade your Python environment to 3.9 or a newer supported version (e.g., 3.10, 3.11, 3.12, 3.13, 3.14).
Ensure you are using Python 3.9+ and the latest `pip`. ConfigSpace 1.1+ removed the direct Cython dependency. If upgrading ConfigSpace is not an option, try `pip install --no-build-isolation ConfigSpace==<version>` or downgrade `numpy` and `Cython` to versions compatible with your Python environment and the ConfigSpace version.
When installing, ensure ConfigSpace is built against the NumPy version already present in your environment. You can try `pip install --no-build-isolation ConfigSpace` to use the installed NumPy, or specify a NumPy version during build by modifying `pyproject.toml` or using a constrained environment.
Upgrade to the latest ConfigSpace version, as many serialization bugs were fixed in later releases (e.g., around versions 0.5.0, 0.6.0, 1.0.1). Refer to the `Serialization` reference in the documentation for best practices.