Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.3K
Visualizações
Why does poetry build raise ModuleOrPackageNotFound exception?

I want to use poetry to build and distribute Python source packages, but after poetry init I get an error running poetry build.

  ModuleOrPackageNotFound
  No file/folder found for package mdspliter.tree
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Reason

The reason it can't be found is most likely because the directory hierarchy is incorrect.

The released package is not directly the source code folder, there are many things in it that are not needed in the final package such as version control, testing and dependency management.

You should put this folder with the same name as the package as a package in that folder.

Solution

  1. Change the directory hierarchy so that there are packages with the corresponding names in the folder.for example:
D:\GitRepository\python_distribution\temp\tree
├──_init__.py
├──tree.py
├──pyproject.toml
└──README.rst

↓

D:\GitRepository\python_distribution\temp\tree
├──tree
│  ├──__init__.py
│  └──tree.py
├──pyproject.toml
└──README.rst
  1. Specify the folder in pyproject.toml
packages = [
    { include = "your_folder_as_pack" }
]

Variants

If the name of the project is mdspliter.tree, then it is not useful at all to include the folder mdspliter.tree, because this naming scheme does not conform to the specification, if you use poetry new mdspliter.tree, you will find that the name of the folder actually should be mdspliter_tree.

(in version 1.2, this behavior has been changed to generate multi-layer folders, mdsplitter/tree)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda