LoginSignup
1
0

rye sync で発生した AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable' の解消

Posted at

Python 3.12.1 を使用して ChromaDB を利用したアプリを作っていて、rye sync したらエラーになりました。
手元のMacでは問題なく動いてたのですが、Debianのイメージを使用したDockerコンテナでrye syncしたらこんなエラーが出ました。

#10 [6/6] RUN <<EOS (rye sync --no-dev --no-lock...)
#10 0.233 Downloading cpython@3.12.1
#10 4.336 Checking checksum
#10 4.865 Unpacking
#10 6.989 Downloaded cpython@3.12.1
#10 7.013 Initializing new virtualenv in /app/.venv
#10 7.013 Python version: cpython@3.12.1
#10 8.143 Installing dependencies
#10 8.144 Creating virtualenv for pip-tools
#10 16.41 Looking in indexes: https://pypi.org/simple/
#10 16.41 Obtaining file:///. (from -r /tmp/tmpdw7wp55s (line 22))
#10 16.41   Installing build dependencies: started
#10 17.77   Installing build dependencies: finished with status 'done'
#10 17.77   Checking if build backend supports build_editable: started
#10 17.83   Checking if build backend supports build_editable: finished with status 'done'
#10 17.83   Getting requirements to build editable: started
#10 17.94   Getting requirements to build editable: finished with status 'done'
#10 17.94   Preparing editable metadata (pyproject.toml): started
#10 18.13   Preparing editable metadata (pyproject.toml): finished with status 'error'
#10 18.14   error: subprocess-exited-with-error
#10 18.14   
#10 18.14   × Preparing editable metadata (pyproject.toml) did not run successfully.
#10 18.14   │ exit code: 1
#10 18.14   ╰─> [29 lines of output]
#10 18.14       Traceback (most recent call last):
#10 18.14         File "/tmp/.tmpMdbbCl/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
#10 18.14           hook = backend.prepare_metadata_for_build_editable
#10 18.14                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#10 18.14       AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
#10 18.14       
#10 18.14       During handling of the above exception, another exception occurred:

を参考に、Python 3.11.7 にしたら解消しました。
ChromaDB側の問題なのかな?

1
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
1
0