Troubleshoot PyPI package installation Stay organized with collections Save and categorize content based on your preferences.
Cloud Composer 3 | Cloud Composer 2 | Cloud Composer 1
Note: This page isnot yet revised for Cloud Composer 3 and displayscontent for Cloud Composer 2.This page explains how to troubleshoot dependency conflicts when installingcustom PyPI packages.
The most common problem with PyPI packages that you might encounter inCloud Composer are dependency conflicts.
When you specify a new custom PyPI package to install, this package or itsversion might cause dependency conflicts with other custom PyPI packages orpreinstalled packages in your environment. In this case, the environmentupdate operation fails with an error.
Cloud Build and in-cluster build errors
If a problem with packages occurs, you get the error message about it in twoways, depending on the way your environment is deployed:
Cloud Build. An error message and a link to theCloud Build log. For example:
UPDATE operation on this environment failed 25 minutes ago with thefollowing error message:Failed to install PyPI packages. Check the Cloud Build log at ...In-cluster builds. An error message and the location of build logs. Forexample:
UPDATE operation on this environment failed 17 minutes ago with thefollowing error message:Failed to install PyPI packages. Check the in-cluster build logs fordetails. They can be found in the Environment logs under the build-log-*log name.
See the detailed error message
When a package installation fails,pip reports the detailed error message.You can find this error message in the build logs.
Locate thepip error in Cloud Build logs
You can follow the link from the Cloud Build error message, orlocate build logs:
Locate build logs:
In Google Cloud console, go to theBuild history page.
Select the failed build to see its logs.
In the build log, find the error message from
pip. For example:ERROR: apache-airflow-backport-providers-google 2021.2.5 has requirementgoogle-cloud-logging<3.0.0,>=2.1.1, but you'll have google-cloud-logging1.15.0 which is incompatible.
Locate thepip error in in-cluster build logs
Locate build logs:
In Google Cloud console, go to theEnvironments page.
Select your environment.
Open theLogs tab.
SelectAll logs >Composer logs >Builds >Worker & Scheduler image.
In theSeverity drop-down list, selectInfo.
In the displayed logs:
Locate the
installer.sherror message. Forexample:The command '/bin/sh -c bash installer.sh $COMPOSER_PYTHON_VERSIONfail' returned a non-zero code: 1The preceding info messages have the detailed
piperror. Forexample:apache-airflow-backport-providers-google 2021.2.5 has requirementgoogle-cloud-logging<3.0.0,>=2.1.1, but you havegoogle-cloud-logging 1.15.0.
Timeouts during Python package installation
In recent versions, thepip utility changed its behavior when attempting tosatisfy dependencies. If specified dependencies can't be satisfied,pip goesthrough all available versions of a package.
When you install a package, the following happens:
If the package isalready preinstalled in your environmentand Python dependencies that you specify don't require any changes, thepackage remains as it is.
Example:
aiodebug==2.3.0is installed and you specifyaiodebugoraiodebug>=2.If the package isn't already installed in your environment or it doesn'tsatisfy Python dependencies you specify, then
piptries to use thelatest version that satisfies dependencies. This is either the latestversion of the package if you didn't specify a version, or the latestversion of the package that satisfies the specified restrictions.Example: If you specify
aiodebug, then the latest will be installed(2.*.*). If you specifyaiodebug<2, then 1.*.* will be installed.If this version causes dependency conflicts with preinstalled packages,
pipgoes through all available versions of the package to try tosatisfy the specified dependency. When it happens, the following messageswill be visible in the build log:INFO: pip is looking at multiple versions of PYTHON_PACKAGE_NAMEto determine which version is compatible with other requirements.This could take a while.Before the change,
pipfailed with a dependency conflict without checkingother versions.
Going through all available versions can take a significant amount of time andlead to a downgrade of packages or to a timeout during the Python packageinstallation.
Preinstalled packages in Cloud Composer are regularly updatedto the latest versions for security reasons. Therefore, a timeout can alsooccur when you upgrade an environment to a later Cloud Composerversion.
Possible solutions:
Regularly update custom Python dependencies.
UsePythonVirtualenvOperatorto isolate code snippets that require conflicting packages.
Conflicts with preinstalled PyPI packages
Some package conflicts occur between custom PyPI packages that you install andthe preinstalled packages.
You can see the full list of preinstalled packages for your version ofCloud Composer on theCloud Composer versions page.
To solve this problem, you can:
Install a different version of the custom PyPI package.
Install a different version of the preinstalled package. To do so,install a custom PyPI packagewith the name of the preinstalled package and specify the required version.We do not recommend downgrading preinstalled packages.
See if laterCloud Composer versions use a differentversion of the preinstalled package. You cancheck for potential PyPI package conflictsbefore you upgrade your environment to a later version ofCloud Composer.
UsePythonVirtualenvOperator to isolate code snippets that require conflicting packages.
Metadata server unavailable when installing PyPI packages
If your environment uses acustompip.conf file,then you might face a problem when no new PyPI packages can be installed inyour environment. In Cloud Build logs related to the packageinstallation error, you can see the following warning message:
WARNING: Compute Engine Metadata server unavailable on attempt 3 of 3. Reason:timed outWARNING: Authentication failed using Compute Engine authentication due tounavailable metadata server.This problem is caused by apip.conf file that does not allow access to thedefault package index athttps://pypi.org/simple. For example, if yourpip.conf file onlypermits installing packages from a custom Artifact Registry repository because ofthe redefinedindex-url parameter, installing packages from thedefault package index is not available.
To solve this problem, make sure thathttps://pypi.org/simple package indexis added to yourpip.conf file. For example, if your primary package indexis defined in theindex-url parameter, add thehttps://pypi.org/simpleindex in theextra-index-url parameter.
extra-index-url parameter, make sure that thepackages are installed from the repository you want to use. Sometimes, usageofextra-index-url parameter might lead toDependency Confusionsituations where a different version of a package might be installed thanoriginally intended.What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-05 UTC.