Skip to content

Editable install fails due to multiple top-level modules (setuptools discovery issue) #387

@tsd10

Description

@tsd10

Description

When attempting to install the repository in editable mode:

uv pip install -e .

or

pip install -e .

the installation fails with the following error:

error: Multiple top-level modules discovered in a flat-layout: ['train', 'prepare'].

This appears to be due to setuptools being unable to automatically determine which modules to include in a flat project layout.

Current Behavior

Editable install fails using both pip and uv pip
Error originates from setuptools package discovery
Expected Behavior

The project should install successfully in editable mode without requiring manual changes to pyproject.toml.

Temporary Fix

Adding the following resolves the issue:

[tool.setuptools]
py-modules = ["train", "prepare"]

Suggested Fixes

One of the following could resolve the issue permanently:

Explicitly define modules in pyproject.toml:

[tool.setuptools]
py-modules = ["train", "prepare"]

Convert to a package structure (recommended):

autoresearch/
init.py
Move to a src/ layout for better packaging practices

Environment

Python: 3.10
Installer: uv (also reproducible with pip)
OS: Linux (HPC cluster)

Additional Context

This issue may affect users trying to extend or modify the project locally using editable installs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions