-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
S: needs triageIssues/PRs that need to be triagedIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behaviorA confirmed bug or unintended behavior
Description
Description
Installing a submodule into a package that has been installed with -e results in not importable submodule.
Expected behavior
Follow the .egg-link and install into that directory.
Alternatively error out if that is deemed not acceptable.
pip version
22.2.2
Python version
3.10
OS
Fedora 36
How to Reproduce
(I provide an example.tar.gz module + submodule for simple/fast testing ; ex1/ provides example1 and ex2/ provides example1/sub1)
pip install -e ex1/
pip install ex2/
python -c "import example1.sub1"
pip install ex1/ works around the issue and works as expected
An alternative fix is to manually link the submodule:
ln -s ../../ex2/example1/sub1/ ex1/example1/sub1
Output
$ tar -xf example.tar.gz
$ pip install -e ex1/
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/dave/tmp/test/ex1
Preparing metadata (setup.py) ... done
Installing collected packages: example1
Attempting uninstall: example1
Found existing installation: example1 0.0.0
Uninstalling example1-0.0.0:
Successfully uninstalled example1-0.0.0
Running setup.py develop for example1
Successfully installed example1-0.0.0
$ pip install ex2/
Defaulting to user installation because normal site-packages is not writeable
Processing ./ex2
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for example1.sub1, since package 'wheel' is not installed.
Installing collected packages: example1.sub1
Attempting uninstall: example1.sub1
Found existing installation: example1.sub1 0.0.0
Uninstalling example1.sub1-0.0.0:
Successfully uninstalled example1.sub1-0.0.0
Running setup.py install for example1.sub1 ... done
Successfully installed example1.sub1-0.0.0
$ python -c "import example1.sub1"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'example1.sub1'
Code of Conduct
- I agree to follow the PSF Code of Conduct.
VolodyaCO, paulmueller and thodkatz
Metadata
Metadata
Assignees
Labels
S: needs triageIssues/PRs that need to be triagedIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behaviorA confirmed bug or unintended behavior