DEV Community

Cover image for Poetry & setuptools trouble fix
Denis Anikin
Denis Anikin

Posted on

Poetry & setuptools trouble fix

If you encounter a problem similar to this:

from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources'
Enter fullscreen mode Exit fullscreen mode

However, there is a chance that you are using poetry and your lock file has a setuptools dependency. And yet, when you install your dependencies, setuptools is missing somewhere. So how do you fix this?
Very simple, but a bit counterintuitive. Simply change your build-system as follows.

...
[build-system]
requires = ["setuptools", "poetry_core>=1.0"]
...
Enter fullscreen mode Exit fullscreen mode

Top comments (0)