apache/beam · warning

You are using version

Error message

You are using version {0} of cython. However, version {1} is recommended.

What it means

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.

Solutions

  1. Upgrade Cython: pip install 'cython>=3.0.0' before building.
  2. If other projects need Cython 0.29, build Beam in a separate virtualenv with Cython 3.x.
  3. Verify with pip show cython / python -c "import cython; print(cython.__version__)".

Example fix

// before
$ pip install cython==0.29.36 && python setup.py build_ext --inplace
// after
$ pip install 'cython>=3.0.0'
$ python setup.py build_ext --inplace
Defensive patterns

Strategy: validation

Validate before calling

import importlib.metadata as md, packaging.version as pv
req = pv.Version('3.0.0')
try:
    if pv.Version(md.version('cython')) < req:
        raise SystemExit('pip install "cython>=3.0.0" before building')
except md.PackageNotFoundError:
    raise SystemExit('cython not installed')

Prevention

When it happens

Trigger: 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.

Common situations: Environments pinned to Cython 0.29 for other packages; conda environments with old cython; CI caches that preinstall Cython before Beam changes its requirement.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/387b1539576fc4ea. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/setup.py:120

try:
  _PIP_VERSION = distribution('pip').version
  if parse(_PIP_VERSION) < parse(RECOMMENDED_MIN_PIP_VERSION):
    warnings.warn(
        "You are using version {0} of pip. " \
        "However, the recommended min version is {1}.".format(
            _PIP_VERSION, RECOMMENDED_MIN_PIP_VERSION
        )
    )
except PackageNotFoundError:
  # Do nothing if pip is not found. This can happen when using `Poetry` or
  # `pipenv` package managers.
  pass

REQUIRED_CYTHON_VERSION = '3.0.0'
try:
  _CYTHON_VERSION = distribution('cython').version
  if parse(_CYTHON_VERSION) < parse(REQUIRED_CYTHON_VERSION):
    warnings.warn(
        "You are using version {0} of cython. " \
        "However, version {1} is recommended.".format(
            _CYTHON_VERSION, REQUIRED_CYTHON_VERSION
        )
    )
except PackageNotFoundError:
  # do nothing if Cython is not installed
  pass

try:
  # pylint: disable=wrong-import-position
  from Cython.Build import cythonize as cythonize0

  def cythonize(*args, **kwargs):
    import numpy
    extensions = cythonize0(*args, **kwargs)
    for e in extensions:
      e.include_dirs.append(numpy.get_include())

View on GitHub (pinned to 12126d8942)