diff --git a/sdks/python/apache_beam/runners/portability/stager.py b/sdks/python/apache_beam/runners/portability/stager.py index aa03082f0d57..17cf6514cace 100644 --- a/sdks/python/apache_beam/runners/portability/stager.py +++ b/sdks/python/apache_beam/runners/portability/stager.py @@ -218,7 +218,7 @@ def create_job_resources( is None) else setup_options.requirements_cache) if (setup_options.requirements_cache != SKIP_REQUIREMENTS_CACHE and not os.path.exists(requirements_cache_path)): - os.makedirs(requirements_cache_path) + os.makedirs(requirements_cache_path, exist_ok=True) # Stage a requirements file if present. if setup_options.requirements_file is not None: