decipher-research-agent icon indicating copy to clipboard operation
decipher-research-agent copied to clipboard

Error: Multiple Top-Level Packages Discovered in Flat-Layout During uv pip install -e .

Open venturero opened this issue 7 months ago • 1 comments

I am experiencing an issue when trying to install my Python package using the command . The following error message is displayed:

 x Failed to build `backend @ file:///C:/Users/decipher-research-agent/backend`
  |-> The build backend returned an error
  `-> Call to `setuptools.build_meta:__legacy__.build_editable` failed (exit code: 1)

      [stderr]
      error: Multiple top-level packages discovered in a flat-layout: ['agents', 'config', 'models', 'routers',
      'services'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.

      hint: This usually indicates a problem with the package or the build environment.

Expected Behavior: The package should be installed successfully without encountering the multiple top-level packages error.

Actual Behavior: The installation fails with the error related to multiple top-level packages and flat-layout.

Additional Information: Python version: Python 3.12.10 Operating System: Windows Request for Help: I would appreciate any guidance on how to resolve this issue, specifically regarding how to properly configure my package structure or to avoid this error.

@mtwn105

venturero avatar Jun 05 '25 18:06 venturero

I have updated the README.md now you can try uv sync instead of uv pip install -e and later run with uv run uvicorn api:app --host 0.0.0.0 --port 8001

mtwn105 avatar Jun 06 '25 03:06 mtwn105