Version 82 of the Python package setuptools removes pkg_resources,
which is a dependency of the docxcompose package used by docxtpl. We get this error message:
Traceback (most recent call last):
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/bin/tb-profiler", line 9, in <module>
import tbprofiler as tbp
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/tbprofiler/__init__.py", line 6, in <module>
from .output import *
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/tbprofiler/output.py", line 2, in <module>
from .docx import write_docx, DocxResultTemplate
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/tbprofiler/docx.py", line 2, in <module>
from docxtpl import DocxTemplate
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/docxtpl/__init__.py", line 13, in <module>
from .subdoc import Subdoc
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/docxtpl/subdoc.py", line 11, in <module>
from docxcompose.properties import CustomProperties
File "/tmp/tmp.Y5i1TCr2v7/a29e5f8f8cbfc178b03a4ed5a373aa5f_/lib/python3.12/site-packages/docxcompose/properties.py", line 18, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
There is a new version 2.0 of docxcompose, which addresses the issue, see e.g. 4teamwork/docxcompose#105, but this new version is not pulled in via conda, as docxtpl depends on docxcompose >=1.4.0,<2.0.0.
Anyways, the quick fix is to pin setuptools<82 in the conda environment.
Version 82 of the Python package
setuptoolsremovespkg_resources,which is a dependency of the
docxcomposepackage used bydocxtpl. We get this error message:There is a new version 2.0 of
docxcompose, which addresses the issue, see e.g. 4teamwork/docxcompose#105, but this new version is not pulled in via conda, asdocxtpldepends ondocxcompose >=1.4.0,<2.0.0.Anyways, the quick fix is to pin
setuptools<82in the conda environment.