Skip to content

Missing distutils and pkg_resources on Python 3.14 #187

@ds-cbo

Description

@ds-cbo

Describe the bug

$ python -m pg_chameleon
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/root/pg_chameleon/pg_chameleon/__init__.py", line 3, in <module>
    from .lib.pg_lib import *
  File "/root/pg_chameleon/pg_chameleon/lib/pg_lib.py", line 12, in <module>
    from distutils.sysconfig import get_python_lib
ModuleNotFoundError: No module named 'distutils'

To Reproduce
Steps to reproduce the behavior:

python3.14 -m venv venv
. ./venv/bin/activate
pip install -e .
python -m pg_chameleon

Expected behavior
No error

Environment(please complete the following information):

  • pg_chameleon latest release: v2.0.21
  • OS: Fedora Server 43
  • Python Version: 3.14

Additional context

Installing setuptools fixes it for now with a deprecation warning on pkg_resources:

/root/pg_chameleon/venv/bin/chameleon.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import get_distribution

A temporary solution for now would be to add a dependency on setuptools, but it would be nicer to get rid of references to distutils and pkg_resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions