-
|
Hello everyone, I’m facing an import conflict caused by two Python packages that both expose the same top-level module name, and I’m looking for best practices to handle this. Problem descriptionIn my project, I need to use:
Both packages install a top-level package named When both dependencies are installed using Poetry, one Example: poetry run python -c "import ulid; print(ulid.__file__)"Only one implementation is available at runtime. Environment
What I’ve tried / understood
Questions
Any guidance or confirmation would be appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
In Python, two dependencies that expose the same top-level module name are not compatible (except for namespace packages, i.e. packages without an |
Beta Was this translation helpful? Give feedback.
In Python, two dependencies that expose the same top-level module name are not compatible (except for namespace packages, i.e. packages without an
__init__.pyand non-conflicting submodules). I am not aware of any tool that can work around this limitation. As far as I know, you can only avoid conflicting dependencies. Another case is when these are not real dependencies, but only tools that are used during development. Then, you can separate them into their own virtualenvs - not with Poetry but with pipx for example.