UPDATE operation on this environment failed 25 minutes ago with the
following error message:
Failed to install PyPI packages. Check the Cloud Build log at ...
叢集內建構。錯誤訊息和建構記錄的位置。例如:
UPDATE operation on this environment failed 17 minutes ago with the
following error message:
Failed to install PyPI packages. Check the in-cluster build logs for
details. They can be found in the Environment logs under the build-log-*
log name.
ERROR: apache-airflow-backport-providers-google 2021.2.5 has requirement
google-cloud-logging<3.0.0,>=2.1.1, but you'll have google-cloud-logging
1.15.0 which is incompatible.
INFO: pip is looking at multiple versions of PYTHON_PACKAGE_NAME
to determine which version is compatible with other requirements.
This could take a while.
WARNING: Compute Engine Metadata server unavailable on attempt 3 of 3. Reason:
timed out
WARNING: Authentication failed using Compute Engine authentication due to
unavailable metadata server.
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-26 (世界標準時間)。"],[[["\u003cp\u003eThis document outlines troubleshooting steps for dependency conflicts that arise when installing custom PyPI packages in Cloud Composer environments.\u003c/p\u003e\n"],["\u003cp\u003eDependency conflicts can cause environment update failures, with error messages and logs available via Cloud Build or in-cluster build logs.\u003c/p\u003e\n"],["\u003cp\u003eConflicts often occur between custom PyPI packages and preinstalled packages, which can be addressed by installing different package versions or using PythonVirtualenvOperator for isolated environments.\u003c/p\u003e\n"],["\u003cp\u003eIf a custom \u003ccode\u003epip.conf\u003c/code\u003e file restricts access to the default package index, it can prevent the installation of new PyPI packages, which is resolved by adding \u003ccode\u003ehttp://pypi.org/simple\u003c/code\u003e to \u003ccode\u003eextra-index-url\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis page currently displays information for Cloud Composer 2 and has not yet been updated for Cloud Composer 3.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot PyPI package installation\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/troubleshooting-package-installation \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/troubleshooting-package-installation \"View this page for Cloud Composer 1\")\n\n\u003cbr /\u003e\n\n| **Note:** This page is **not yet revised for Cloud Composer 3** and displays content for Cloud Composer 2.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page explains how to troubleshoot dependency conflicts when installing\ncustom PyPI packages.\n\nThe most common problem with PyPI packages that you might encounter in\nCloud Composer are dependency conflicts.\n\nWhen you specify a new custom PyPI package to install, this package or its\nversion might cause dependency conflicts with other custom PyPI packages or\npreinstalled packages in your environment. In this case, the environment\nupdate operation fails with an error.\n\nCloud Build and in-cluster build errors\n---------------------------------------\n\nIf a problem with packages occurs, you get the error message about it in two\nways, depending on the way your environment is deployed:\n\n- **Cloud Build**. An error message and a link to the\n Cloud Build log. For example:\n\n UPDATE operation on this environment failed 25 minutes ago with the\n following error message:\n Failed to install PyPI packages. Check the Cloud Build log at ...\n\n- **In-cluster builds**. An error message and the location of build logs. For\n example:\n\n UPDATE operation on this environment failed 17 minutes ago with the\n following error message:\n Failed to install PyPI packages. Check the in-cluster build logs for\n details. They can be found in the Environment logs under the build-log-*\n log name.\n\nSee the detailed error message\n------------------------------\n\nWhen a package installation fails, `pip` reports the detailed error message.\nYou can find this error message in the build logs.\n\n### Locate the `pip` error in Cloud Build logs\n\nYou can follow the link from the Cloud Build error message, or\nlocate build logs:\n\n1. Locate build logs:\n\n 1. In Google Cloud console, go to the **Build history** page.\n\n [Go to Build history](https://console.cloud.google.com/cloud-build/builds)\n 2. Select the failed build to see its logs.\n\n2. In the build log, find the error message from `pip`. For example:\n\n ERROR: apache-airflow-backport-providers-google 2021.2.5 has requirement\n google-cloud-logging\u003c3.0.0,\u003e=2.1.1, but you'll have google-cloud-logging\n 1.15.0 which is incompatible.\n\n### Locate the `pip` error in in-cluster build logs\n\n1. Locate build logs:\n\n 1. In Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n 2. Select your environment.\n\n 3. Open the **Logs** tab.\n\n 4. Select **All logs** \\\u003e **Composer logs** \\\u003e **Builds** \\\u003e\n **Worker \\& Scheduler image**.\n\n 5. In the **Severity** drop-down list, select **Info**.\n\n2. In the displayed logs:\n\n 1. Locate the `installer.sh` error message. For\n example:\n\n The command '/bin/sh -c bash installer.sh $COMPOSER_PYTHON_VERSION\n fail' returned a non-zero code: 1\n\n 2. The preceding info messages have the detailed `pip` error. For\n example:\n\n apache-airflow-backport-providers-google 2021.2.5 has requirement\n google-cloud-logging\u003c3.0.0,\u003e=2.1.1, but you have\n google-cloud-logging 1.15.0.\n\nTimeouts during Python package installation\n-------------------------------------------\n\nIn recent versions, the `pip` utility changed its behavior when attempting to\nsatisfy dependencies. If specified dependencies can't be satisfied, `pip` goes\nthrough all available versions of a package.\n\nWhen you install a package, the following happens:\n\n1. If the package is [already preinstalled](/composer/docs/composer-versions) in your environment\n and Python dependencies that you specify don't require any changes, the\n package remains as it is.\n\n Example: `aiodebug==2.3.0` is installed and you specify `aiodebug` or\n `aiodebug\u003e=2`.\n2. If the package isn't already installed in your environment or it doesn't\n satisfy Python dependencies you specify, then `pip` tries to use the\n latest version that satisfies dependencies. This is either the latest\n version of the package if you didn't specify a version, or the latest\n version of the package that satisfies the specified restrictions.\n\n Example: If you specify `aiodebug`, then the latest will be installed\n (2.\\*.\\*). If you specify `aiodebug\u003c2`, then 1.\\*.\\* will be installed.\n\n If this version causes dependency conflicts with preinstalled packages,\n `pip` **goes through all available versions** of the package to try to\n satisfy the specified dependency. When it happens, the following messages\n will be visible in the build log: \n\n INFO: pip is looking at multiple versions of PYTHON_PACKAGE_NAME\n to determine which version is compatible with other requirements.\n This could take a while.\n\n Before the change, `pip` failed with a dependency conflict without checking\n other versions.\n\nGoing through all available versions can take a significant amount of time and\nlead to a downgrade of packages or to a timeout during the Python package\ninstallation.\n\nPreinstalled packages in Cloud Composer are regularly updated\nto the latest versions for security reasons. Therefore, a timeout can also\noccur when you upgrade an environment to a later Cloud Composer\nversion.\n\n**Possible solutions:**\n\n- Regularly update custom Python dependencies.\n\n- Use [PythonVirtualenvOperator](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/python.html#pythonvirtualenvoperator)\n to isolate code snippets that require conflicting packages.\n\nConflicts with preinstalled PyPI packages\n-----------------------------------------\n\nSome package conflicts occur between custom PyPI packages that you install and\nthe preinstalled packages.\n\nYou can see the full list of preinstalled packages for your version of\nCloud Composer on the\n[Cloud Composer versions](/composer/docs/composer-versions) page.\n\nTo solve this problem, you can:\n\n- Install a different version of the custom PyPI package.\n\n- Install a different version of the preinstalled package. To do so,\n [install a custom PyPI package](/composer/docs/composer-2/install-python-dependencies#install-pypi)\n with the name of the preinstalled package and specify the required version.\n We do not recommend downgrading preinstalled packages.\n\n- See if later [Cloud Composer versions](/composer/docs/composer-versions) use a different\n version of the preinstalled package. You can\n [check for potential PyPI package conflicts](/composer/docs/composer-2/upgrade-environments#upgrade-check)\n before you upgrade your environment to a later version of\n Cloud Composer.\n\n- Use [PythonVirtualenvOperator](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/python.html#pythonvirtualenvoperator)\n to isolate code snippets that require conflicting packages.\n\nMetadata server unavailable when installing PyPI packages\n---------------------------------------------------------\n\nIf your environment uses a [custom `pip.conf` file](/composer/docs/composer-2/install-python-dependencies),\nthen you might face a problem when no new PyPI packages can be installed in\nyour environment. In Cloud Build logs related to the package\ninstallation error, you can see the following warning message: \n\n WARNING: Compute Engine Metadata server unavailable on attempt 3 of 3. Reason:\n timed out\n WARNING: Authentication failed using Compute Engine authentication due to\n unavailable metadata server.\n\nThis problem is caused by a `pip.conf` file that does not allow access to the\n[default package index](https://pypi.org/simple)\nat `https://pypi.org/simple`. For example, if your `pip.conf` file only\npermits installing packages from a custom Artifact Registry repository because of\nthe redefined `index-url` parameter, installing packages from the\ndefault package index is not available.\n\nTo solve this problem, make sure that `https://pypi.org/simple` package index\nis added to your `pip.conf` file. For example, if your primary package index\nis defined in the `index-url` parameter, add the `https://pypi.org/simple`\nindex in the `extra-index-url` parameter.\n| **Warning:** When using `extra-index-url` parameter, make sure that the packages are installed from the repository you want to use. Sometimes, usage of `extra-index-url` parameter might lead to [Dependency Confusion](/software-supply-chain-security/docs/dependencies#public-dependencies) situations where a different version of a package might be installed than originally intended.\n\nWhat's next\n-----------\n\n- [Installing Python dependencies](/composer/docs/composer-2/install-python-dependencies)\n- [Troubleshooting environment updates and upgrades](/composer/docs/composer-2/troubleshooting-updates-upgrades)"]]