Registry / ai-ml / configspace

configspace

JSON →
library1.2.2pypypi✓ verified 86d ago

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 ConfigSpace
INSTALL
IMPORT
SIG · CONFIGSPACE
C
configspace
ai-mlpythonv1.2.2
Install
7.6s avg
Import
3062ms
Disk
233MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.2 · 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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 3.140s · 233.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 7.6s · import 2.985s · 224MB
233MB installed
● package 233MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ConfigurationSpace
from ConfigSpace import ConfigurationSpace
Float
from ConfigSpace import Float
Integer
from ConfigSpace import Integer
Categorical
from ConfigSpace import Categorical

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.

from ConfigSpace import ConfigurationSpace, Float, Integer # Create a simple ConfigurationSpace cs = ConfigurationSpace(space={ "alpha": (0.0, 1.0, 0.5), # UniformFloat with lower, upper, default "max_iter": (10, 100, 55), # UniformInteger with lower, upper, default }, seed=1234) print(cs) # Sample a configuration config = cs.sample_configuration() print(config) # Access values like a dictionary print(f"Alpha: {config['alpha']}")
Debug
Known issues
breakingThe 'q' parameter for numerical hyperparameters (e.g., `FloatHyperparameter`, `IntegerHyperparameter`) was removed in ConfigSpace 1.0. This change simplifies the API.
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.
affects: >=1.0.0
deprecatedMany 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.
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.
affects: >=1.1.0
gotchaUsing `EqualsCondition` or `InCondition` with `Float` hyperparameters can lead to unexpected behavior due to floating-point numerical rounding issues.
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.
affects: All versions
breakingConfigSpace 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.
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).
affects: >=1.2.2
Errors
Common errors & fixes
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'
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.
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.
ImportError: building ConfigSpace against numpy 1.20.0+ results in problems when importing with older numpy versions.
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`).
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.
Errors when reading/writing ConfigurationSpace objects, especially with Forbidden or Condition clauses.
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.
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.
Upgrade
Version history
1.2.2latest on PyPI · released Dec 19, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.9 or higher. Support for Python 3.8 was dropped in version 1.2.2.
numpyrequiredCore dependency for numerical operations, specifically important during the build process.
Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
configspace — pip install configspace · libregistry