Repository navigation
Replies: 1 comment
|
Your project folder and package share the name Quick check: import setuptools_test
print(setuptools_test, getattr(setuptools_test, "__file__", None))
Pick one fix:
from setuptools_test.base import FirstClass
# or: from ..base import FirstClass
pip install -e . --config-settings editable_mode=strictPitfall: with a flat layout, avoid running Python with cwd set to the parent of the project folder. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.tomlsetuptools_test/setuptools_test/__init__.pysetuptools_test/setuptools_test/base.pysetuptools_test/setuptools_test/module/__init__.pysetuptools_test/setuptools_test/module/base.pyProblem 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``
All reactions