Skip to content

fix: Fix editable install: Inclulde packages for PEP660 (pip>=25)#137

Open
dasoumao wants to merge 1 commit intoLifelong-Robot-Learning:masterfrom
dasoumao:fix/pep660-editable-import
Open

fix: Fix editable install: Inclulde packages for PEP660 (pip>=25)#137
dasoumao wants to merge 1 commit intoLifelong-Robot-Learning:masterfrom
dasoumao:fix/pep660-editable-import

Conversation

@dasoumao
Copy link

Description

This PR fixes an issue where pip install -e LIBERO (editable install) dose not expose any importable Python packages under modern pip (PEP 517/660). As a result:

  • import libero fails with ModuleNotFoundError when execute outside the repository directory.

This shows up reliably with recent pip (pip=25.3), which use PEP 660 editable installs and only maps packages explicitly discovered in the build configuration.

Root cause

The repo's top level libero/ directory is not a Python package (missing init.py file, also the libero/lifelong/models/modules/), so setuptools.find_packages() can fail to discover the expected libero.* packages depending on layout and tooling.

Reproduction

Origin version:

(base) dasoumao@Mao16plus:~/0Project/LIBERO$ pip -V
pip 25.0 from /home/dasoumao/miniconda3/lib/python3.12/site-packages/pip (python 3.12)
(base) dasoumao@Mao16plus:~/0Project/LIBERO$ python
Python 3.12.9 | packaged by Anaconda, Inc. | (main, Feb  6 2025, 18:56:27) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> from setuptools import find_packages
>>> packages = [package for package in find_packages() if package.startswith("libero")]
>>> print(packages)
[]
>>> 

After Fixed:

(base) dasoumao@Mao16plus:~/0Project/LIBERO$ pip -V
pip 25.0 from /home/dasoumao/miniconda3/lib/python3.12/site-packages/pip (python 3.12)
(base) dasoumao@Mao16plus:~/0Project/LIBERO$ python
Python 3.12.9 | packaged by Anaconda, Inc. | (main, Feb  6 2025, 18:56:27) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> from setuptools import find_packages
>>> packages = [package for package in find_packages() if package.startswith("libero")]
>>> print(packages)
['libero', 'libero.configs', 'libero.lifelong', 'libero.libero', 'libero.lifelong.algos', 'libero.lifelong.models', 'libero.lifelong.models.modules', 'libero.libero.utils', 'libero.libero.benchmark', 'libero.libero.envs', 'libero.libero.envs.regions', 'libero.libero.envs.robots', 'libero.libero.envs.arenas', 'libero.libero.envs.problems', 'libero.libero.envs.predicates', 'libero.libero.envs.objects', 'libero.libero.envs.object_states']
>>>

Note on prior work (duplicate PRs)

I realize similar changes were proposed before in #15 and #117 . This PR is a duplicate in terms of the mechanical changes, but I’m submitting it again because the reason has become more important recently: modern pip versions (pip >= 25.3) use PEP 660 editable installs, which are stricter than legacy setup.py develop behavior and therefore expose this packaging issue consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant