Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Poetry install ChefBuildError

Poetry install fails with ChefBuildError: Backend operation failed: HookMissing('build_editable')

My poetry version is 1.4.2

like image 690
Joshua Patterson Avatar asked May 29 '26 17:05

Joshua Patterson


2 Answers

This worked for me

I believe this is caused by a change to how the build-backend is defined in the pyproject.toml between poetry ^1.3 and poetry ^1.4. Assuming you have poetry ^1.4 installed you have two options:

  1. In your pyproject.toml change build-backend = "poetry.masonry.api" to build-backend = "poetry.core.masonry.api"

  2. If, like me you have other code the assumes poetry ^1.3 then simply downgrade you poetry version poetry self update 1.3.2


If you go with option 2 you may get a bunch of RuntimeError hash for xxx errors. If that's the case you will also need to rm -r ~/.cache/pypoetry/artifacts and rm -r ~/.cache/pypoetry/cache.

like image 122
Joshua Patterson Avatar answered Jun 01 '26 17:06

Joshua Patterson


Does your project name differ from your src directory?

e.g. project name is py-project and src dir is scripts, then try adding packages = [{include = "scripts"}] to your pyproject.toml

[tool.poetry]
name = "py-project"
...
packages = [{include = "scripts"}]
like image 43
Janphr Avatar answered Jun 01 '26 18:06

Janphr