{"record":{"id":"aab9bc11754a9750","repo":"pandas-dev/pandas","slug":"pyarrow-pyarrow-min-version-is-required-for-pya-aab9bc","errorCode":null,"errorMessage":"pyarrow>={PYARROW_MIN_VERSION} is required for PyArrow backed ArrowExtensionArray.","messagePattern":"pyarrow>=(.+?) is required for PyArrow backed ArrowExtensionArray\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/string_arrow.py","lineNumber":76,"sourceCode":"        AxisInt,\n        Dtype,\n        NpDtype,\n        Scalar,\n        npt,\n    )\n\n    from pandas.core.dtypes.dtypes import ExtensionDtype\n\n    from pandas import Series\n\n\ndef _check_pyarrow_available() -> None:\n    if not HAS_PYARROW:\n        msg = (\n            f\"pyarrow>={PYARROW_MIN_VERSION} is required for PyArrow \"\n            \"backed ArrowExtensionArray.\"\n        )\n        raise ImportError(msg)\n\n\ndef _is_string_view(typ):\n    return not pa_version_under16p0 and pa.types.is_string_view(typ)\n\n\n# TODO: Inherit directly from BaseStringArrayMethods. Currently we inherit from\n# ObjectStringArrayMixin because we want to have the object-dtype based methods as\n# fallback for the ones that pyarrow doesn't yet support\n\n\n@set_module(\"pandas.arrays\")\nclass ArrowStringArray(ObjectStringArrayMixin, ArrowExtensionArray, BaseStringArray):\n    \"\"\"\n    Extension array for string data in a ``pyarrow.ChunkedArray``.\n\n    .. warning::\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/pandas-dev/pandas/blob/71959b8cb9b2459c16e14b34f28b178ccfe14735/pandas/core/arrays/string_arrow.py#L58-L94","documentation":"Raised by _check_pyarrow_available() when HAS_PYARROW is False, i.e. the pyarrow package is not importable or is older than pandas' declared PYARROW_MIN_VERSION. ArrowExtensionArray and ArrowStringArray (the 'string[pyarrow]' / ArrowDtype backends) are only functional with a sufficiently recent pyarrow, so importing or constructing them without it fails fast with an ImportError rather than producing a broken object.","triggerScenarios":"Calling pd.array(data, dtype='string[pyarrow]'), pd.ArrowDtype(...), or pd.Series(..., dtype=pd.ArrowDtype(pa.string())) in an environment where pyarrow is missing or below the minimum. Also triggered by read_csv(..., engine='pyarrow') paths that materialize ArrowExtensionArray.","commonSituations":"Fresh virtualenv/conda env without pyarrow installed; CI image that pip-installs only pandas; downgrading pyarrow below the min version; deploying a slim Docker image that strips optional deps.","solutions":["Install or upgrade pyarrow: `pip install -U pyarrow` (or `conda install pyarrow`).","Pin pyarrow to at least pandas' PYARROW_MIN_VERSION (check `from pandas.compat import PYARROW_MIN_VERSION`).","If pyarrow is intentionally absent, fall back to the object/python string backend by using dtype='string' or dtype='string[python]' instead of 'string[pyarrow]'.","For Docker/CI, add pyarrow to the requirements file and rebuild the image."],"exampleFix":"# before\npd.array(['a','b'], dtype='string[pyarrow]')  # ImportError if pyarrow missing\n# after\n# pip install pyarrow\npd.array(['a','b'], dtype='string[pyarrow]')","handlingStrategy":"validation","validationCode":"from pandas.compat import HAS_PYARROW, PYARROW_MIN_VERSION\n\ndef require_pyarrow():\n    if not HAS_PYARROW:\n        raise ImportError(f'pyarrow>={PYARROW_MIN_VERSION} required; pip install pyarrow')\n    import pyarrow as pa\n    return pa","typeGuard":"from pandas.compat import HAS_PYARROW\ndef has_pyarrow_backend() -> bool:\n    return HAS_PYARROW","tryCatchPattern":"try:\n    arr = pd.array(data, dtype='string[pyarrow]')\nexcept ImportError:\n    arr = pd.array(data, dtype='string[python]')  # fallback","preventionTips":["Pin pyarrow>=PYARROW_MIN_VERSION in requirements.txt / pyproject.toml.","Feature-detect HAS_PYARROW before opting into Arrow backends.","Document the optional dependency in your package install extras."],"tags":["pyarrow","importerror","dependencies","string-arrow"],"analyzedSha":"71959b8cb9b2459c16e14b34f28b178ccfe14735","analyzedAt":"2026-08-07T01:30:20.476Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}