{"record":{"id":"387b1539576fc4ea","repo":"apache/beam","slug":"you-are-using-version-0-of-cython-however-version-1-is","errorCode":null,"errorMessage":"You are using version {0} of cython. However, version {1} is recommended.","messagePattern":"You are using version (.+?) of cython\\. However, version (.+?) is recommended\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/python/setup.py","lineNumber":120,"sourceCode":"try:\n  _PIP_VERSION = distribution('pip').version\n  if parse(_PIP_VERSION) < parse(RECOMMENDED_MIN_PIP_VERSION):\n    warnings.warn(\n        \"You are using version {0} of pip. \" \\\n        \"However, the recommended min version is {1}.\".format(\n            _PIP_VERSION, RECOMMENDED_MIN_PIP_VERSION\n        )\n    )\nexcept PackageNotFoundError:\n  # Do nothing if pip is not found. This can happen when using `Poetry` or\n  # `pipenv` package managers.\n  pass\n\nREQUIRED_CYTHON_VERSION = '3.0.0'\ntry:\n  _CYTHON_VERSION = distribution('cython').version\n  if parse(_CYTHON_VERSION) < parse(REQUIRED_CYTHON_VERSION):\n    warnings.warn(\n        \"You are using version {0} of cython. \" \\\n        \"However, version {1} is recommended.\".format(\n            _CYTHON_VERSION, REQUIRED_CYTHON_VERSION\n        )\n    )\nexcept PackageNotFoundError:\n  # do nothing if Cython is not installed\n  pass\n\ntry:\n  # pylint: disable=wrong-import-position\n  from Cython.Build import cythonize as cythonize0\n\n  def cythonize(*args, **kwargs):\n    import numpy\n    extensions = cythonize0(*args, **kwargs)\n    for e in extensions:\n      e.include_dirs.append(numpy.get_include())","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/setup.py#L102-L138","documentation":"Beam's setup.py warns when the installed Cython version is below the required minimum (3.0.0). Older Cython may generate incompatible or slow native extensions; the warning is non-fatal and setup continues with whatever Cython is present.","triggerScenarios":"Building/installing Beam from source (python setup.py build_ext, pip install from sdist) while distribution('cython').version < 3.0.0, e.g. Cython 0.29.x installed.","commonSituations":"Environments pinned to Cython 0.29 for other packages; conda environments with old cython; CI caches that preinstall Cython before Beam changes its requirement.","solutions":["Upgrade Cython: pip install 'cython>=3.0.0' before building.","If other projects need Cython 0.29, build Beam in a separate virtualenv with Cython 3.x.","Verify with pip show cython / python -c \"import cython; print(cython.__version__)\"."],"exampleFix":"// before\n$ pip install cython==0.29.36 && python setup.py build_ext --inplace\n// after\n$ pip install 'cython>=3.0.0'\n$ python setup.py build_ext --inplace","handlingStrategy":"validation","validationCode":"import importlib.metadata as md, packaging.version as pv\nreq = pv.Version('3.0.0')\ntry:\n    if pv.Version(md.version('cython')) < req:\n        raise SystemExit('pip install \"cython>=3.0.0\" before building')\nexcept md.PackageNotFoundError:\n    raise SystemExit('cython not installed')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin cython>=3.0.0 in build requirements / pyproject build-system requires","Check cython version in CI before running build_ext","Isolate builds in virtualenvs so unrelated pins don't downgrade cython"],"tags":["python","cython","build","version-check"],"backgroundTag":"dependency-version-incompatible","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}