Skip to content

ModuleNotFoundError: No module named 'pkg_resources' with setuptools 82 #115

@matthuisman

Description

@matthuisman

setuptools 82 was released 9th Feb 2026 and has removed pkg_resources
https://setuptools.pypa.io/en/stable/history.html

So importing docxcompose now causes

venv313\Lib\site-packages\docxcompose\composer.py:12: in <module>
    from docxcompose.properties import CustomProperties
venv313\Lib\site-packages\docxcompose\properties.py:18: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'

This affects all python versions that setuptools is released for

For myself and others, I have published a new pypi package called docxcompose3
Which is simply docxcompose with PR #113 and few fixes to packaging

https://pypi.org/project/docxcompose3/

You should be able to simply swap your dependency to this and then work with newer setuptools

Hopefully this can help others :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions