{"record":{"id":"9492f898b3f48768","repo":"pandas-dev/pandas","slug":"please-upgrade-numpy-to-min-numpy-ver-to-use","errorCode":null,"errorMessage":"Please upgrade numpy to >= {_min_numpy_ver} to use this pandas version.\nYour numpy version is {_np_version}.","messagePattern":"Please upgrade numpy to >= (.+?) to use this pandas version\\.\nYour numpy version is (.+?)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"pandas/compat/numpy/__init__.py","lineNumber":19,"sourceCode":"\"\"\"support numpy compatibility across versions\"\"\"\n\nimport numpy as np\n\nfrom pandas.util.version import Version\n\n# numpy versioning\n_np_version = np.__version__\n_nlv = Version(_np_version)\nnp_version_gt2_2 = _nlv >= Version(\"2.2.0\")\nnp_version_gt2_3 = _nlv >= Version(\"2.3.0\")\nnp_version_gt2_5 = _nlv >= Version(\"2.5.0\")\nnp_version_gt2_6 = _nlv >= Version(\"2.6.0.dev0\")\nis_numpy_dev = _nlv.dev is not None\n_min_numpy_ver = \"2.0.2\"\n\n\nif _nlv < Version(_min_numpy_ver):\n    raise ImportError(\n        f\"Please upgrade numpy to >= {_min_numpy_ver} to use this pandas version.\\n\"\n        f\"Your numpy version is {_np_version}.\"\n    )\n\n\n__all__ = [\n    \"_np_version\",\n    \"is_numpy_dev\",\n]\n","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/compat/numpy/__init__.py#L1-L29","documentation":"Raised at pandas import time (in pandas.compat.numpy) when the installed numpy is older than the floor pandas was built against (`_min_numpy_ver`, currently '2.0.2'). This is a hard import-time gate: pandas will not finish importing, so any `import pandas` fails before user code runs. The message states both the required minimum and the detected version.","triggerScenarios":"`import pandas as pd` in an environment where numpy is pinned below 2.0.2 (e.g. a legacy environment with numpy 1.26); CI matrix accidentally testing old numpy with new pandas.","commonSituations":"Pinning numpy for another library (e.g. an old tensorflow) below pandas' floor; fresh conda env that resolved an old numpy; mixed pip+conda installs.","solutions":["Upgrade numpy: `pip install -U 'numpy>=2.0.2'` or `conda install 'numpy>=2.0.2'`.","If you must keep the old numpy, install an older pandas whose `_min_numpy_ver` is satisfied (e.g. pandas 2.2.x).","Resolve dependency conflicts with `pip check` and a clean venv."],"exampleFix":"// before\npip install numpy==1.26\nimport pandas as pd  # fails\n\n// after\npip install 'numpy>=2.0.2'\nimport pandas as pd","handlingStrategy":"validation","validationCode":"import numpy as np\nfrom packaging.version import Version\nassert Version(np.__version__) >= Version('2.0.2')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin numpy>=2.0.2 alongside pandas in requirements files.","Use a clean venv when numpy version conflicts arise.","Run `pip check` after dependency changes."],"tags":["dependencies","numpy","import-time","version-mismatch"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}