Open5

Rye 0.25.0 メモ

zztkmzztkm

前提

  • 基本 Windows 11 (WSL のときは WSL Ubuntu などを明記する
  • uv を有効化して使っている
zztkmzztkm

rye sync が失敗するようになった

sora-python-sdk-samples on  feature/refactoring [!] is 📦 v2024.1.0 via 🐍 v3.8.18 on ☁️  (ap-northeast-1)
❯ rye self update
Updating to latest
Checking checksum
Updated!

rye 0.25.0
commit: 0.25.0 (d8e00cea1 2024-02-19)
platform: windows (x86_64)
self-python: cpython@3.12
symlink support: true
uv enabled: true
sora-python-sdk-samples on  feature/refactoring [!] is 📦 v2024.1.0 via 🐍 on ☁️  (ap-northeast-1)
❯ rye sync -f
detected outdated rye internals. Refreshing
Bootstrapping rye internals
Found a compatible Python version: cpython@3.12.1
Upgrading pip
Installing internal dependencies
Initializing new virtualenv in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Python version: cpython@3.8.18
Generating production lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements.lock
error: Failed to run `py --list-paths` to find Python installations. Is Python installed?
  Caused by: program not found
error: could not write production lockfile for project

Caused by:
    failed to generate lockfile
exit status 1

3.12 にしてみても同じ(そういう問題ではないだろうし)

❯ rye pin 3.12
pinned 3.12.1 in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.python-version
sora-python-sdk-samples on  feature/refactoring [!] is 📦 v2024.1.0 via 🐍 v3.12.1 on ☁️  (ap-northeast-1)
❯ rye sync -f
Initializing new virtualenv in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Python version: cpython@3.12.1
Generating production lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements.lock
error: Failed to run `py --list-paths` to find Python installations. Is Python installed?
  Caused by: program not found
error: could not write production lockfile for project

Caused by:
    failed to generate lockfile
exit status 1

uv を無効化してみても同様のエラー

❯ rye sync -f
Initializing new virtualenv in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Python version: cpython@3.11.7
Generating production lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements.lock
error: could not write production lockfile for project

Caused by:
    0: unable to run pip-compile
    1: 指定されたファイルが見つかりません。 (os error 2)
exit status 1
sora-python-sdk-samples on  feature/refactoring [!] is 📦 v2024.1.0 via 🐍 v3.11.7 on ☁️  (ap-northeast-1)

uv 有効化したあとに -v で詳細ログを出してみる

❯ rye sync -f -v
Python version already downloaded. Skipping.
Initializing new virtualenv in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Python version: cpython@3.11.7
 uv_interpreter::python_query::find_requested_python request="C:\\Users\\takum\\.rye\\py\\cpython@3.11.7\\install\\python.exe", platform=Platform { os: Windows, arch: X86_64 }, cache=Cache { root: "\\\\?\\C:\\Users\\takum\\AppData\\Local\\uv\\cache", refresh: None, _temp_dir_drop: None }
      0.003570s   0ms DEBUG uv_interpreter::interpreter Using cached markers for: \\?\C:\Users\takum\.rye\py\cpython@3.11.7\install\python.exe
Using Python 3.11.7 interpreter at C:\Users\takum\.rye\py\cpython@3.11.7\install\python.exe
Creating virtualenv at: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Generating production lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements.lock
 uv::requirements::from_source source=C:\Users\takum\AppData\Local\Temp\.tmp84ANlH
 uv::requirements::from_source source=C:\Users\takum\AppData\Local\Temp\.tmp6ah3h5\requirements.txt
    0.004627s DEBUG uv_interpreter::virtual_env Found a virtualenv named .venv at: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
    0.004994s DEBUG uv_interpreter::interpreter Using cached markers for: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv\Scripts\python.exe
 uv_interpreter::python_query::find_requested_python request="3.11.7", platform=Platform { os: Windows, arch: X86_64 }, cache=Cache { root: "\\\\?\\C:\\Users\\takum\\AppData\\Local\\uv\\cache", refresh: None, _temp_dir_drop: None }
   uv_interpreter::python_query::py_list_paths
error: Failed to run `py --list-paths` to find Python installations. Is Python installed?
  Caused by: program not found
error: could not write production lockfile for project

Caused by:
    failed to generate lockfile
exit status 1

インタプリタを見つけられなくなった??

0.24.0 に戻してみるとうまくいった。

❯ rye self update --version 0.24.0
Updating to 0.24.0
Checking checksum
Updated!

rye 0.24.0
commit: 0.24.0 (8d56aa18a 2024-02-15)
platform: windows (x86_64)
self-python: cpython@3.12
symlink support: true

❯ rye sync -f
Initializing new virtualenv in C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\.venv
Python version: cpython@3.11.7
warning: uv enabled in config but not supported on windows
warning: uv enabled in config but not supported on windows
Generating production lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements.lock
warning: uv enabled in config but not supported on windows
Generating dev lockfile: C:\Users\takum\dev\github.com\shiguredo\sora-python-sdk-samples\requirements-dev.lock
warning: uv enabled in config but not supported on windows
Installing dependencies

(省略)
Building wheels for collected packages: sora-sdk-samples
  Building editable for sora-sdk-samples (pyproject.toml) ... done
  Created wheel for sora-sdk-samples: filename=sora_sdk_samples-2024.1.0-py3-none-any.whl size=6344 sha256=7e45a7afba3ace2419c476cd87ff02a943efaeb812e249c18dd4f5d86ca86341
  Stored in directory: C:\Users\takum\AppData\Local\Temp\pip-ephem-wheel-cache-giedsyo0\wheels\97\54\f5\d849319cdfa096e074df352654ee2e7c919da8951f090690c6
Successfully built sora-sdk-samples
Installing collected packages: mediapipe, flatbuffers, cffi, sounddevice, sora-sdk-samples, sora-sdk, six, ruff, python-dotenv, python-dateutil, pyparsing, pycparser, protobuf, pillow, packaging, opencv-python-headless, opencv-python, opencv-contrib-python, numpy, matplotlib, kiwisolver, fonttools, cycler, contourpy, attrs, absl-py
Successfully installed absl-py-1.4.0 attrs-23.1.0 cffi-1.15.1 contourpy-1.1.0 cycler-0.11.0 flatbuffers-23.5.26 fonttools-4.40.0 kiwisolver-1.4.4 matplotlib-3.7.2 mediapipe-0.10.1 numpy-1.24.4 opencv-contrib-python-4.8.0.74 opencv-python-4.9.0.80 opencv-python-headless-4.9.0.80 packaging-23.1 pillow-10.0.0 protobuf-3.20.3 pycparser-2.21 pyparsing-3.0.9 python-dateutil-2.8.2 python-dotenv-1.0.1 ruff-0.2.1 six-1.16.0 sora-sdk-2024.1.0 sora-sdk-samples-2024.1.0 sounddevice-0.4.6
Done!
zztkmzztkm

0.26.0 にアップグレードしたら直った。
なんでやろうね。