Unable to find submodule when poetry install or poetry build #10202
Unanswered
juanjomendezhealios
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋 , I'm trying to create a package that contains multiple subpackages. My intention is to create a package with extras so we can use it to only install the required subpackages in another environment, using
pip install my_package.whl[sub_package_a]
.The structure of my project is as follow:
The structure of
directory/pyproject.toml
is:On the other hand, the structure of
directory/package/package_a/pyproject.toml
is:When I do
poetry install -E sub_package_a
, the environment is created and when I list the packages installed in there, I can observe the packagesub_package_a
. Although, when I start a python shell, I try to import the sub-package (import sub_package_a
) and it raises an error ofModuleNotFound
.Furthermore, I when I ran
poetry build
, the whl and sdist files are created correctly, and thesub_package_a
can be installed viapip install my_package.whl[sub_package_a]
. Although, it happens the same as before, the package is installed (that is what pip shows), but when I try to import the module, it is not found.Can someone help me with this? 🙏
I have observed that poetry is very powerful, but there are some things that are not covered in the documentation and are pretty interesting to know; e.g. creating a package with extras to not to install the full package in another environment, only the necessary stuff.
Beta Was this translation helpful? Give feedback.
All reactions