You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't manage to make the editable mode pip install -e . work for a local installation of my project. After the installation, when I import a constructor from a module of my package within in python shell instance running outside my project directory, I got an import error. Here is reproducible example to understand my problem.
What am I missing ?
note : without the editable mode, everything works
Problem Then, in setuptools_test/, after running python -m pip install -e ., outside setuptools_test/, I got :
>>> from setuptools_test.module import SecondClass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../setuptools_test/setuptools_test/module/__init__.py", line 1, in <module>
from .base import SecondClass
File ".../setuptools_test/setuptools_test/module/base.py", line 1, in <module>
from setuptools_test import FirstClass
ImportError: cannot import name 'FirstClass' from 'setuptools_test' (unknown location)
But, without the editable mode, it works.
Versions installed
ubuntu 22.04.4, python 3.11 installed with apt
pip 25.2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I don't manage to make the editable mode
pip install -e .
work for a local installation of my project. After the installation, when I import a constructor from a module of my package within in python shell instance running outside my project directory, I got an import error. Here is reproducible example to understand my problem.What am I missing ?
note : without the editable mode, everything works
Example
setuptools_test/pyproject.toml
setuptools_test/setuptools_test/__init__.py
setuptools_test/setuptools_test/base.py
setuptools_test/setuptools_test/module/__init__.py
setuptools_test/setuptools_test/module/base.py
Problem Then, in
setuptools_test/
, after runningpython -m pip install -e .
, outsidesetuptools_test/
, I got :But, without the editable mode, it works.
Versions installed
ubuntu 22.04.4, python 3.11 installed with apt
pip 25.2
version from `python -m pip freeze --all``
Beta Was this translation helpful? Give feedback.
All reactions