Old post:
Iβm trying to set up a virtual environment where I can contribute to two packages from separate Github repositories where one depends on the other. Iβve cloned the child package and installed it in editable mode (pip install -e). The parent package is in the virtual environmentβs site-packages. I would like to install it in editable mode as well from the Github repository, and have it recognized as a dependency of the child package.
I created the virtual environment with the command:
python -m venv .venv
I did what you suggested, the packages and their dependencies are installed, but I canβt import them in a python script in the virtual environment (it cannot resolve the import).
I suspect it has something to do with the following namespace having conflicting definitions ?
Even if I install one of the packages as editable and the other as a regular dependency, the editable package cannot be imported. So this may not have anything to do with the projectβs structure but something could be wrong with my venv.
I started from scratch in a new virtual environment:
venv .venv and activate it
git clone https://github.com/rm-hull/luma.lcd.git
python -m pip install -e ./luma.lcd
Create a test.py file in the root dir and try to import luma.lcd
luma.lcd cannot be imported but its (non-editable) dependency luma.core can.
I found this issue that led me to reinstall the package using an older version of setuptools that doesnβt create the file __editable__.luma_lcd-2.11.0.finder but relies on some older mechanics. The import now works in VS Code. Still not sure whatβs wrong with the newer setuptools.
It turns out, the code runs fine. VS Codeβs pylance extension shows a hint under the import statement saying the module cannot be resolved, and I trusted it, but running the code produces no error. Iβm sorry for wasting everyoneβs time.