Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12: ModuleNotFoundError: No module named 'setuptools' / 'distutils' #764

Closed
hugovk opened this issue Sep 11, 2023 · 1 comment
Closed

Comments

@hugovk
Copy link
Contributor

hugovk commented Sep 11, 2023

The Python 3.12 release candidate is out! 馃殌

Call to action

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.12 compatibilities during this phase, and where necessary publish Python 3.12 wheels on PyPI to be ready for the final release of 3.12.0.

See also https://dev.to/hugovk/help-test-python-312-beta-1508/

Python 3.12.0 final will be released in 3 weeks: https://peps.python.org/pep-0693/


However, when adding 3.12 to the CI like hugovk@44152a4, it fails with:

> Run python setup.py test
Traceback (most recent call last):
  File "/home/runner/work/pycryptodome/pycryptodome/setup.py", line 26, in <module>
    from setuptools import Extension, Command, setup
ModuleNotFoundError: No module named 'setuptools'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/pycryptodome/pycryptodome/setup.py", line 30, in <module>
    from distutils.core import Extension, Command, setup
ModuleNotFoundError: No module named 'distutils'

This will be due to the setuptools changes in Python 3.12:

easy_install, pkg_resources, setuptools and distutils are no longer provided by default in environments created with venv or bootstrapped with ensurepip, since they are part of the setuptools package. For projects relying on these at runtime, the setuptools project should be declared as a dependency and installed separately (typically, using pip).

https://docs.python.org/3.12/whatsnew/3.12.html#removed

See also gitpython-developers/GitPython#1640 (comment) for more advice.

@Legrandin
Copy link
Owner

With the new release v3.19, pip will install setuptools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants