0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

uv=0.5.22からエラーが出るようになった

以前の手順

.template_sam:
  image: public.ecr.aws/sam/build-python3.11
  before_script:
    - *use_aws_credentials
    - python -V
    - sam --version
    - pip install --upgrade pip
    - pip install uv
    - uv sync
    - source .venv/bin/activate
$ pip install uv
Collecting uv
  Downloading uv-0.5.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Downloading uv-0.5.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.1/16.1 MB 110.1 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.5.22
$ uv sync
error: Failed to inspect Python interpreter from search path at `/usr/bin/python`
  Caused by: Can't use Python at `/usr/bin/python`
  Caused by: Python executable does not support `-I` flag. Please use Python 3.8 or newer.

指定されたパス /usr/bin/python に存在する Python インタプリタを正しく検出または確認できなかったことを示しています。

Python 仮想環境(venv)を有効化してから、uv syncする

.gitlab-ci.yml
.template_sam:
  variables:
    PYTHON_VERSION: 3.11
    UV_VERSION: 0.5.22
    UV_LINK_MODE: copy
    SAM_CLI_TELEMETRY: 0 # AWS SAM セッションのテレメトリの無効化
  image: public.ecr.aws/sam/build-python$PYTHON_VERSION
  before_script:
    - *use_aws_credentials
    - python -V
    - sam --version
    - pip install --upgrade pip
    - pip install uv==$UV_VERSION
    - uv venv
    - source .venv/bin/activate
    - uv sync
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?