How to install multiple python namespace packages in editable mode

  pip, python, setuptools

I created multiple packages according to the PEP420 implicit namespace packaging method. Two of those distribution packages are dende-github-api and dende-gitlab-api. Each of those distributions contains one module which I want to be accessible unter the dende.api namespace. A minimal working example can be found here:

This is the folder structure of the Repository containing both distributions:

├── dende-github-api
│   ├── dende
│   │   └── api
│   │       ├──
│   │       └──
│   └──
├── dende-gitlab-api
│   ├── dende
│   │   └── api
│   │       ├──
│   │       └──
│   └──
└── requirements.txt

And the‘s look like this (only showing for dende-github-api):

from setuptools import setup


I can install both distributions and use them just fine:

$ pip install ./dende-github-api ./dende-gitlab-api
$ python -m dende.api.github
Hi from dende-github-api from /home/c/git/example-monorepositry/venv/lib/python3.8/site-packages/dende/api/
$ python -m dende.api.gitlab
Hi from dende-gitlab-api from /home/c/git/example-monorepositry/venv/lib/python3.8/site-packages/dende/api/

When I install both distributions in editable mode, only one of the installations work:

$ pip install -e ./dende-github-api ./dende-gitlab-api
python -m dende.api.gitlab                          
Hi from dende-gitlab-api from /home/c/git/example-monorepositry/venv/lib/python3.8/site-packages/dende/api/
python -m dende.api.github
/home/c/git/example-monorepositry/venv/bin/python: No module named dende.api.github

Somehow the second installation seems to shadow the installation of the oder distribution in the overlapping namespace. Is there a way to install overlapping packages like these in editable mode?

Source: Python Questions