我在 Cloud Composer 中安装诗歌时遇到以下问题。 URLObject 安装失败。 寻找解决相同问题的建议,因为我的在线搜索没有得到任何结果。
shell脚本部分是
cat ${SPARK_HOME}/conf/spark-defaults.conf
export POETRY_HOME=/etc/poetry
export PATH="/etc/poetry/bin:$PATH"
curl -sSLfo poetry-install.py https://install.python-poetry.org \
&& python3 poetry-install.py --version 1.3.2
apt-get update && apt-get install -y pkgconf libhdf5-dev
cd $CODE_DIR/ingest && poetry config virtualenvs.in-project true && poetry install && source .venv/bin/activate
pip3 install shortuuid
我相信“cd $CODE_DIR/ingest &&诗歌配置virtualenvs.in-project true &&诗歌安装&&源.venv/bin/activate”行导致了问题。
[2024-01-09, 12:24:50 UTC] {pod_manager.py:431} INFO - [base] • Installing urlobject (2.4.3)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] • Installing websocket-client (0.59.0)
2024-01-09T12:24:55.208257615Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] CalledProcessError
2024-01-09T12:24:55.208333478Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Command '['/tmp/backend/ingest/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/tmp/backend/ingest/.venv', '--no-deps', '/root/.cache/pypoetry/artifacts/23/1e/82/ffa13ae9fb790ca9aab416980cfab9da947b36f6fe14267ae27813c9f3/URLObject-2.4.3.tar.gz']' returned non-zero exit status 1.
2024-01-09T12:24:55.208628370Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] at /usr/lib/python3.8/subprocess.py:516 in run
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 512│ # We don't call process.wait() as .__exit__ does that for us.
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 513│ raise
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 514│ retcode = process.poll()
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 515│ if check and retcode:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] → 516│ raise CalledProcessError(retcode, process.args,
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 517│ output=stdout, stderr=stderr)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 518│ return CompletedProcess(process.args, retcode, stdout, stderr)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 519│
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 520│
2024-01-09T12:24:55.385496695Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] The following error occurred when trying to handle this error:
2024-01-09T12:24:55.385507722Z
2024-01-09T12:24:55.385512832Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] EnvCommandError
2024-01-09T12:24:55.385524223Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Command ['/tmp/backend/ingest/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/tmp/backend/ingest/.venv', '--no-deps', '/root/.cache/pypoetry/artifacts/23/1e/82/ffa13ae9fb790ca9aab416980cfab9da947b36f6fe14267ae27813c9f3/URLObject-2.4.3.tar.gz'] errored with the following return code 1, and output:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Processing /root/.cache/pypoetry/artifacts/23/1e/82/ffa13ae9fb790ca9aab416980cfab9da947b36f6fe14267ae27813c9f3/URLObject-2.4.3.tar.gz
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Installing build dependencies: started
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Installing build dependencies: finished with status 'error'
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] error: subprocess-exited-with-error
2024-01-09T12:24:55.385596508Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] × pip subprocess to install build dependencies did not run successfully.
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] │ exit code: 1
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] ╰─> [15 lines of output]
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Collecting setuptools>=40.8.0
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Downloading setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Collecting wheel
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Downloading setuptools-69.0.3-py3-none-any.whl (819 kB)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.5/819.5 kB 10.0 MB/s eta 0:00:00
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] unknown package:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Expected sha256 177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Got e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2024-01-09T12:24:55.386460841Z
2024-01-09T12:24:55.386465642Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] [notice] A new release of pip is available: 23.3 -> 23.3.2
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] [notice] To update, run: pip install --upgrade pip
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] [end of output]
2024-01-09T12:24:55.386485896Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] note: This error originates from a subprocess, and is likely not a problem with pip.
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] error: subprocess-exited-with-error
2024-01-09T12:24:55.386500760Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] × pip subprocess to install build dependencies did not run successfully.
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] │ exit code: 1
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] ╰─> See above for output.
2024-01-09T12:24:55.386520313Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] note: This error originates from a subprocess, and is likely not a problem with pip.
2024-01-09T12:24:55.386538557Z
2024-01-09T12:24:55.386554330Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] at /etc/poetry/venv/lib/python3.8/site-packages/poetry/utils/env.py:1540 in _run
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1536│ output = subprocess.check_output(
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1537│ command, stderr=subprocess.STDOUT, env=env, **kwargs
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1538│ )
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1539│ except CalledProcessError as e:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] → 1540│ raise EnvCommandError(e, input=input_)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1541│
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1542│ return decode(output)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1543│
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 1544│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
2024-01-09T12:24:55.553353534Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] The following error occurred when trying to handle this error:
2024-01-09T12:24:55.553448024Z
2024-01-09T12:24:55.553459187Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] PoetryException
2024-01-09T12:24:55.553539955Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] Failed to install /root/.cache/pypoetry/artifacts/23/1e/82/ffa13ae9fb790ca9aab416980cfab9da947b36f6fe14267ae27813c9f3/URLObject-2.4.3.tar.gz
2024-01-09T12:24:55.554136296Z
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] at /etc/poetry/venv/lib/python3.8/site-packages/poetry/utils/pip.py:58 in pip_install
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 54│
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 55│ try:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 56│ return environment.run_pip(*args)
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] 57│ except EnvCommandError as e:
[2024-01-09, 12:24:55 UTC] {pod_manager.py:431} INFO - [base] → 58│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
[2024-01-09, 12:24:57 UTC] {pod_manager.py:431} INFO - [base] 59│
2024-01-09T12:24:55.560534096Z
[2024-01-09, 12:25:00 UTC] {pod_manager.py:431} INFO - [base] Warning: The file chosen for install of s3transfer 0.8.1 (s3transfer-0.8.1-py3-none-any.whl) is yanked.
[2024-01-09, 12:25:00 UTC] {pod_manager.py:431} INFO - [base] Collecting shortuuid
[2024-01-09, 12:25:00 UTC] {pod_manager.py:431} INFO - [base] Downloading shortuuid-1.0.11-py3-none-any.whl (10 kB)
您对导致错误的行是正确的。具体看来
poetry install
似乎是错误的命令。
据我所知,是
poetry.lock
导致了这个问题。问题似乎您之前可能使用过不同版本的诗歌,但您的缓存库是以前运行产生的。
以下行(除了警告)给出正确的提示:
Warning: The file chosen for install of s3transfer 0.8.1 (s3transfer-0.8.1-py3-none-any.whl) is yanked.
此功能已在1.2.0rc1
中添加这可能不是您问题的解决方案,因为它很难重现。但过去我也遇到过类似的问题,我需要清理缓存并重新创建
poetry.lock
。
请记住,重新创建
poetry.lock
可能会使 diff 该文件变得更加麻烦。