-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install --editable does not work as expected for namespace packages #7265
Comments
Does the same behaviour happen if you use |
Using |
I think the problem is due to the presence of a I recommend this excellent documentation page about namespace packages which says that native namespace packages cannot have |
I you absolutely need a
in it should work. Make sure you then have no Note this is probably on the fringe of supported use cases, so YMMV. |
Your two comments seem contradictory. I am going to ignore the first one. I do obviously need an I do have an The error I am reporting only occurs for |
I don't think this use case is supported by PEP 420. Note the state of the system in With
Whether When we execute
Once finished, Python searches for With
And our project directory looks like this
And our
When we execute I would confirm first that namespace packages work this way (with a non-namespace parent) maybe on discuss.python.org/c/packaging and then if this is supposed to work I would reach out on the setuptools issue tracker to see if anyone there has advice. |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Environment
Description
This is not a duplicate of #3
I have a
mainpackage
that is a standard package with an__init__.py
. It has a subpackage,mainpackage.ext
, that is a namespace package according to PEP 420 (no__init__.py
).All of this is located in a
main_package
folder with asetup.py
.Now I have a separate folder
some_plugin
with anothersetup.py
. This folder contains a plugin formainpackage
. It therefore has a packagemainpackage.ext.someplugin
with an__init__.py
inmainpackage/ext/someplugin/
but not inmainpackage/
ormainpackage/ext/
.Using a normal
pip install
, this works as expected. But when usingpip install -e
to install bothmain_package
andsome_plugin
, the plugin cannot actually be imported.Expected behavior
Same behavior between
pip install
andpip install -e
, i.e. the ability to importmainpackage.ext.someplugin
without aModuleNotFoundError
.How to Reproduce
I've created a repository with a minimal example: https://github.com/jonasrauber/python_namespace_packages_editable_bug
Works
Fails
The text was updated successfully, but these errors were encountered: