{"record":{"id":"4eb2c36666d12eae","repo":"apache/beam","slug":"error-installing-dependencies","errorCode":null,"errorMessage":"error installing dependencies","messagePattern":"error installing dependencies","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go","lineNumber":482,"sourceCode":"\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":464,"sourceCodeEnd":492,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go#L464-L492","documentation":"Raised in expansionx.SetUpPythonEnvironment when installing the caller-supplied extra packages into the expansion service virtualenv fails. These are the dependencies the user requested alongside apache_beam for the transform being expanded.","triggerScenarios":"startPythonExpansionService -> SetUpPythonEnvironment with non-empty extraPackages where `pip install <extraPackages...>` returns non-zero: a typo'd or nonexistent package name, an unresolvable version pin, or no network.","commonSituations":"Extra packages requiring compilation toolchains (e.g. numpy/pandas on odd platforms); private packages not on public PyPI; version pins conflicting with apache_beam's requirements; proxy-blocked downloads.","solutions":["Verify each extra package name and version pin is correct and resolvable on the configured index","Install the extras manually in the venv to surface the concrete pip error","Add a private index (--extra-index-url / PIP_EXTRA_INDEX_URL) if packages come from an internal registry","Relax conflicting pins or move heavy native deps to wheels compatible with the platform"],"exampleFix":"// before\nxlangx.SetUpPythonEnvironment(ctx, \"python3\", pyPackage, []string{\"mypkg==9.9.9\"}) // nonexistent pin\n// after\nxlangx.SetUpPythonEnvironment(ctx, \"python3\", pyPackage, []string{\"mypkg==1.2.0\"})","handlingStrategy":"validation","validationCode":"for _, p := range extraPackages {\n    name, _, _ := strings.Cut(p, \"==\")\n    if !knownOnIndex(name) {\n        return fmt.Errorf(\"extra package %q not found on configured index\", p)\n    }\n}","typeGuard":null,"tryCatchPattern":"python, err := expansionx.SetUpPythonEnvironment(ctx, py, pkg, extras)\nif err != nil && strings.Contains(err.Error(), \"error installing dependencies\") {\n    return fmt.Errorf(\"extra packages %v failed to install; verify names/versions and index access: %w\", extras, err)\n}","preventionTips":["Verify every extra package name and pin resolves on the target index","Configure private index URLs for internal packages","Keep extras minimal and compatible with the pinned apache_beam version"],"tags":["python","pip","dependencies","cross-language"],"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"}