{"record":{"id":"bda22174d770ea9f","repo":"apache/beam","slug":"cannot-find-default-beam-sdk-tar-file-s","errorCode":null,"errorMessage":"Cannot find default Beam SDK tar file \"%s\"","messagePattern":"Cannot find default Beam SDK tar file \"(.+?)\"","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/stager.py","lineNumber":366,"sourceCode":"          # Equivalent to 'default' now, leaving for backwards compatibility.\n          pass\n        else:\n          if os.path.isdir(setup_options.sdk_location):\n            sdk_path = os.path.join(\n                setup_options.sdk_location, names.STAGED_SDK_SOURCES_FILENAME)\n          else:\n            sdk_path = setup_options.sdk_location\n\n          if os.path.isfile(sdk_path):\n            _LOGGER.info('Copying Beam SDK \"%s\" to staging location.', sdk_path)\n            resources.append(\n                Stager._create_file_stage_to_artifact(\n                    sdk_path,\n                    Stager._desired_sdk_filename_in_staging_location(\n                        setup_options.sdk_location)))\n          else:\n            if setup_options.sdk_location == 'default':\n              raise RuntimeError(\n                  'Cannot find default Beam SDK tar file \"%s\"' % sdk_path)\n            elif not setup_options.sdk_location:\n              _LOGGER.info(\n                  'Beam SDK will not be staged since --sdk_location '\n                  'is empty.')\n            else:\n              raise RuntimeError(\n                  'The file \"%s\" cannot be found. Its location was specified '\n                  'by the --sdk_location command-line option.' % sdk_path)\n    # The following artifacts are not processed by python sdk container boot\n    # sequence in a setup mode and hence should not be skipped even if a\n    # prebuilt sdk container image is used.\n\n    # TODO(heejong): remove jar_packages experimental flag when cross-language\n    #   dependency management is implemented for all runners.\n    # Handle jar packages that should be staged for Java SDK Harness.\n    jar_packages = options.view_as(DebugOptions).lookup_experiment(\n        'jar_packages')","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/stager.py#L348-L384","documentation":"When --sdk_location is left at 'default', Beam expects a locally installed SDK tarball (apache_beam-*.tar.gz in the installed package directory). This RuntimeError is raised when that default tarball file cannot be found on disk.","triggerScenarios":"create_job_resources with sdk_location == 'default' and the expected default sdk_path does not exist (os.path.exists false).","commonSituations":"Beam installed from a git checkout or via a mechanism that did not ship the source tarball (e.g. some pip installs, conda, or slim containers); running with an editable install lacking the built tarball.","solutions":["Install a packaged Beam release (pip install apache_beam) so the SDK tarball is present","Set --sdk_location explicitly to a local apache_beam-*.tar.gz or a https:// URL to one from PyPI","Set --sdk_location='' to skip staging the SDK when a prebuilt SDK container image is used (--prebuild_sdk_container_engine or environment_type=DOCKER/PROCESS)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import apache_beam, os, glob\nsdks = glob.glob(os.path.join(os.path.dirname(apache_beam.__file__), 'apache_beam-*.tar.gz'))\nif not sdks:\n    options.sdk_location = 'https://files.pythonhosted.org/...'  # or prebuild container","typeGuard":"def default_sdk_tarball_exists():\n    import apache_beam, glob, os\n    return bool(glob.glob(os.path.join(os.path.dirname(apache_beam.__file__), '*.tar.gz')))","tryCatchPattern":"try:\n    stager.create_and_stage_job_resources(setup_options)\nexcept RuntimeError as e:\n    if 'Cannot find default Beam SDK tar file' in str(e):\n        sys.exit('Install a packaged apache_beam release or set --sdk_location / prebuild SDK container')\n    raise","preventionTips":["Install Beam from a regular pip release rather than an editable/checkout install","Prefer --environment_type=PROCESS/DOCKER or prebuilt SDK images when the tarball is absent","Set --sdk_location explicitly in CI where installs are trimmed"],"tags":["python","installation","sdk-tarball","beam"],"backgroundTag":"file-not-found","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"}