fix(packaging): add missing embodiedscan/__init__.py so pip install -e works#117
Open
Monalissaa wants to merge 1 commit intoInternRobotics:mainfrom
Open
fix(packaging): add missing embodiedscan/__init__.py so pip install -e works#117Monalissaa wants to merge 1 commit intoInternRobotics:mainfrom
Monalissaa wants to merge 1 commit intoInternRobotics:mainfrom
Conversation
Without this file, `setup.py`'s `find_packages(exclude=...)` returns
an empty list for the top-level `embodiedscan` directory (because it
has no `__init__.py`), so a fresh `pip install -e .` registers no
top-level package and `import embodiedscan` raises ModuleNotFoundError
on modern setuptools (PEP 660 editable installs). Subpackages like
`embodiedscan.visualization` etc. do have `__init__.py` and would be
registered, but they only become reachable through the top-level
namespace once the parent package is registered.
Adding an empty `embodiedscan/__init__.py` is the minimal fix; an
alternative would be to switch to `find_namespace_packages()` in
setup.py.
Reproducer:
git clone https://github.com/OpenRobotLab/EmbodiedScan
python -m venv /tmp/venv && source /tmp/venv/bin/activate
pip install -e EmbodiedScan
python -c "import embodiedscan"
# → ModuleNotFoundError: No module named 'embodiedscan'
After this fix, the same flow imports cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Monalissaa
added a commit
to Monalissaa/OpenSpatial
that referenced
this pull request
May 8, 2026
Add a `touch embodiedscan/__init__.py` step before `pip install -e` so fresh-env users don't hit `ModuleNotFoundError: embodiedscan` from the upstream packaging bug. Tracked upstream as InternRobotics/EmbodiedScan#117; this README line can be dropped once that's merged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A fresh
pip install -e .succeeds butimport embodiedscanraisesModuleNotFoundErroron modern setuptools (PEP 660 editable installs). Root cause:setup.pyusesfind_packages(exclude=...), which requires every package directory to contain an__init__.py. The top-levelembodiedscan/directory has none, sofind_packagesreturns an empty list for it, and the editable install registers no top-level package.This PR adds an empty
embodiedscan/__init__.py— the minimal fix. An alternative would be switching tofind_namespace_packages()insetup.py, but that has broader implications; adding the marker file is the safer change.Reproducer
After this PR, the same flow imports cleanly. Tested with
setuptools 80.x+pip 24.0on Python 3.10.Why this surfaces now
PEP 660 editable installs (
pip>=21.3with modern setuptools) generate a metadata-driven finder built fromfind_packagesoutput. Oldereasy-install.pth-based editable installs masked this by simply prepending the project root tosys.path, soimport embodiedscanworked even without registration. Anyone setting up a fresh environment today hits the failure.Notes
embodiedscan.visualization,embodiedscan.models, etc.) all have their own__init__.pyalready and are registered correctly — they just become unreachable when the parent isn't.