{"id":8031,"library":"configspace","title":"ConfigSpace","description":"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.","status":"active","version":"1.2.2","language":"en","source_language":"en","source_url":"https://github.com/automl/ConfigSpace","tags":["hyperparameter tuning","machine learning","configuration space","HPO","AutoML"],"install":[{"cmd":"pip install ConfigSpace","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Requires Python 3.9 or higher. Support for Python 3.8 was dropped in version 1.2.2.","package":"python","optional":false},{"reason":"Core dependency for numerical operations, specifically important during the build process.","package":"numpy","optional":false}],"imports":[{"symbol":"ConfigurationSpace","correct":"from ConfigSpace import ConfigurationSpace"},{"symbol":"Float","correct":"from ConfigSpace import Float"},{"symbol":"Integer","correct":"from ConfigSpace import Integer"},{"symbol":"Categorical","correct":"from ConfigSpace import Categorical"}],"quickstart":{"code":"from ConfigSpace import ConfigurationSpace, Float, Integer\n\n# Create a simple ConfigurationSpace\ncs = ConfigurationSpace(space={\n    \"alpha\": (0.0, 1.0, 0.5), # UniformFloat with lower, upper, default\n    \"max_iter\": (10, 100, 55), # UniformInteger with lower, upper, default\n}, seed=1234)\n\nprint(cs)\n\n# Sample a configuration\nconfig = cs.sample_configuration()\nprint(config)\n\n# Access values like a dictionary\nprint(f\"Alpha: {config['alpha']}\")","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"The 'q' parameter for numerical hyperparameters (e.g., `FloatHyperparameter`, `IntegerHyperparameter`) was removed in ConfigSpace 1.0. This change simplifies the API.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"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.","message":"Many older functions were deprecated in ConfigSpace 1.1 as part of an API simplification and clarity improvement. While efforts were made to maintain backward compatibility, using the new functionality is recommended.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"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.","message":"Using `EqualsCondition` or `InCondition` with `Float` hyperparameters can lead to unexpected behavior due to floating-point numerical rounding issues.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to 3.9 or a newer supported version (e.g., 3.10, 3.11, 3.12, 3.13, 3.14).","message":"ConfigSpace version 1.2.2 (and potentially earlier 1.x releases) dropped official support for Python 3.8. The library now explicitly requires Python 3.9 or higher.","severity":"breaking","affected_versions":">=1.2.2"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"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.","cause":"This error, particularly the `_abc_registry` AttributeError, often occurred during the installation of older ConfigSpace versions (pre-1.1) due to incompatibilities with specific Python or `pip` environments, especially when `Cython` was a direct build dependency.","error":"ERROR: Command errored out with exit status 1: command: 'python.exe' 'pip' install ... -- setuptools wheel numpy Cython ... AttributeError: type object 'Callable' has no attribute '_abc_registry'"},{"fix":"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.","cause":"ConfigSpace compilation against NumPy 1.20.0 or newer can lead to `ImportError` when the runtime environment uses an older NumPy version, due to changes in NumPy's internal object sizes (`PyObject size`).","error":"ImportError: building ConfigSpace against numpy 1.20.0+ results in problems when importing with older numpy versions."},{"fix":"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.","cause":"Older versions of ConfigSpace had issues with serialization and deserialization of complex ConfigurationSpaces containing conditional dependencies or forbidden clauses, particularly to formats like JSON or PCS.","error":"Errors when reading/writing ConfigurationSpace objects, especially with Forbidden or Condition clauses."}]}