{"record":{"id":"d417246dcd219d17","repo":"apache/beam","slug":"error-installing-beam-package-v","errorCode":null,"errorMessage":"error installing beam package: %v","messagePattern":"error installing beam package: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go","lineNumber":475,"sourceCode":"\t)\n\tvenvPython := filepath.Join(venvDir, \"bin\", \"python\")\n\n\tif _, err := os.Stat(venvPython); err != nil {\n\t\terr := exec.Command(py, \"-m\", \"venv\", venvDir).Run()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"error creating new virtual environment for python expansion service\")\n\t\t}\n\t\terr = exec.Command(venvPython, \"-m\", \"pip\", \"install\", \"--upgrade\", \"pip\").Run()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"error upgrading pip\")\n\t\t}\n\t\terr = exec.Command(venvPython, \"-m\", \"pip\", \"install\", \"--upgrade\", \"setuptools\").Run()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"error upgrading setuptools\")\n\t\t}\n\t\terr = exec.Command(venvPython, \"-m\", \"pip\", \"install\", beamPackage, \"pyparsing==2.4.2\").Run()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, fmt.Sprintf(\"error installing beam package: %v\", beamPackage))\n\t\t}\n\t\tif len(extraPackages) > 0 {\n\t\t\tcmd := []string{\"-m\", \"pip\", \"install\"}\n\t\t\tcmd = append(cmd, extraPackages...)\n\t\t\terr = exec.Command(venvPython, cmd...).Run()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", errors.Wrap(err, \"error installing dependencies\")\n\t\t\t}\n\t\t}\n\t\terr = exec.Command(venvPython, \"-c\", \"import apache_beam\").Run()\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrap(err, \"apache beam installation failed in virtualenv\")\n\t\t}\n\t}\n\treturn venvPython, nil\n}\n","sourceCodeStart":457,"sourceCodeEnd":492,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go#L457-L492","documentation":"Raised in expansionx.SetUpPythonEnvironment when installing the apache_beam package (beamPackage) into the expansion service virtualenv fails. The message includes the specific beam package spec being installed. Without apache_beam, the Python expansion service cannot start.","triggerScenarios":"startPythonExpansionService -> SetUpPythonEnvironment where `pip install <beamPackage> pyparsing==2.4.2` fails: unsatisfiable dependencies, no matching apache_beam wheel for the Python version/platform, or network failure.","commonSituations":"Using a Python version with no prebuilt apache_beam wheel (too new/old); PyPI unreachable; conflicts from an existing apache_beam or incompatible pyparsing; disk space or compiler missing for source builds.","solutions":["Use a supported Python version (e.g. 3.8–3.11) that has apache_beam wheels on PyPI","Run the install manually in the venv to read the real pip resolution error","Ensure network/proxy access to PyPI and sufficient disk space","Remove conflicting preinstalled apache_beam/pyparsing versions in the environment chain"],"exampleFix":"// before\npython3.12 -m venv venv  # no apache_beam wheel yet\n// after\npython3.10 -m venv venv  # supported interpreter with wheels","handlingStrategy":"validation","validationCode":"if !supportedPythonForBeam(pyVersion) { // e.g. allow only 3.8-3.11\n    return fmt.Errorf(\"python %s has no apache_beam wheels; use a supported version\", pyVersion)\n}","typeGuard":null,"tryCatchPattern":"python, err := expansionx.SetUpPythonEnvironment(ctx, py, pkg, extras)\nif err != nil && strings.Contains(err.Error(), \"error installing beam package\") {\n    return fmt.Errorf(\"apache_beam install failed; check Python version/network and run pip manually for details: %w\", err)\n}","preventionTips":["Run a Python version with published apache_beam wheels","Preinstall apache_beam in a test venv to validate the package spec","Avoid conflicting pins (pyparsing, protobuf) in the same environment"],"tags":["python","pip","apache-beam","dependency-installation"],"backgroundTag":"missing-dependency","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"}