{"record":{"id":"dfa85a054708ff62","repo":"reflex-dev/reflex","slug":"toml-support-is-not-available-please-use-python-3","errorCode":null,"errorMessage":"TOML support is not available. Please use Python 3.11 or later.","messagePattern":"TOML support is not available\\. Please use Python 3\\.11 or later\\.","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/core/config.py","lineNumber":255,"sourceCode":"\n        Args:\n            pyproject_path: The path to the TOML file. Defaults to \"pyproject.toml\" in the current directory.\n            env: The environment to load the config for.\n\n        Returns:\n            Config: A Config instance with the values from the TOML file.\n\n        Raises:\n            ConfigError: If the TOML file is not found.\n\n        \"\"\"\n        if not pyproject_path.exists():\n            raise ConfigError(f\"Config file not found at {pyproject_path}.\")\n\n        try:\n            import tomllib\n        except ImportError as e:\n            raise ConfigError(\n                \"TOML support is not available. Please use Python 3.11 or later.\"\n            ) from e\n\n        with pyproject_path.open(\"rb\") as file:\n            pyproject_data = tomllib.load(file)\n            if not isinstance(pyproject_data, dict):\n                raise ConfigError(\n                    f\"Invalid TOML file format at {pyproject_path}. Expected a dictionary.\"\n                )\n            tools = pyproject_data.get(\"tool\", {})\n            if not isinstance(tools, dict):\n                raise ConfigError(\n                    f\"Invalid TOML file format at {pyproject_path}. Expected 'tool' to be a dictionary.\"\n                )\n            if \"reflex-cloud\" not in tools:\n                raise ConfigError(\n                    f\"Invalid TOML file format at {pyproject_path}. Expected 'tool.reflex-cloud' to be present.\"\n                )","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/core/config.py#L237-L273","documentation":"ConfigError raised when the stdlib tomllib module cannot be imported while parsing a TOML config. tomllib only exists on Python 3.11+, so this fires on older interpreters.","triggerScenarios":"Calling CloudConfig.from_toml on Python < 3.11, where `import tomllib` raises ImportError.","commonSituations":"Running the hosting CLI with an older system Python (3.9/3.10); a venv created from an outdated interpreter; CI images pinned to old Python versions.","solutions":["Upgrade to Python 3.11 or later and recreate your virtualenv","Or point the CLI at a YAML config (rxconfig.yaml with PyYAML installed) to avoid tomllib entirely"],"exampleFix":"# before: python3.10 -m reflex_cli ...\n\n# after\npython3.12 -m reflex_cli ...  # tomllib available","handlingStrategy":"validation","validationCode":"import sys\nif sys.version_info < (3, 11):\n    raise RuntimeError(\"reflex-hosting-cli TOML config requires Python 3.11+\")\nconfig = CloudConfig.from_toml(p)","typeGuard":null,"tryCatchPattern":"try:\n    config = CloudConfig.from_toml(p)\nexcept ConfigError as e:\n    if \"Python 3.11\" in str(e):\n        config = CloudConfig.from_yaml(yaml_path)  # requires pyyaml\n    else:\n        raise","preventionTips":["Pin Python >= 3.11 in your project (.python-version, CI image, Dockerfile)","Prefer YAML config when you must support older Pythons"],"tags":["python-version","toml","import-error","reflex-hosting-cli"],"backgroundTag":"unsupported-python-version","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}