Zope5.10 with python3.12.3 issue

Installing zope5.10 with python3.12.3 I get this error:
ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/myusername/apps/zope5plus/zope5100/lib/python3.12/site-packages/pkg_resources/init.py)

I think this is happening because of pkg_resources deprecation - see Package Discovery and Resource Access using pkg_resources - setuptools 70.0.0.post20240531 documentation.
A deprecation warning was added in version 67.3.0 of setuptools - History - setuptools 70.0.0.post20240531 documentation.

Can you paste the full stacktrace?

According to Python 3.12 support release blockers · Issue #1123 · zopefoundation/Zope · GitHub Zope 5.10 is fully compatible with Python 3.12.1. If that is not true, then you should file an issue in that repo with full details of how to reproduce it. Thank you!

Steve Piercy via Plone Community wrote at 2024-6-2 21:53 +0000:

Can you paste the full stacktrace?

According to Python 3.12 support release blockers · Issue #1123 · zopefoundation/Zope · GitHub Zope 5.10 is fully compatible with Python 3.12.1. If that is not true, then you should file an issue in that repo with full details of how to reproduce it. Thank you!

I assume a setuptools incompatibility.
The OP could try setuptools==69.0.2.

Here it is:

[myusername zope5plus]$ python3.12 -m venv zope5100
[myusername zope5plus]$ cd zope5100/
[myusername zope5100]$ nano buildout.cfg
[myusername zope5100]$ bin/pip install -U pip wheel
Requirement already satisfied: pip in ./lib/python3.12/site-packages (24.0)
Collecting wheel
Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 1.4 MB/s eta 0:00:00
Installing collected packages: wheel
Successfully installed wheel-0.43.0
[myusername zope5100]$ bin/pip install -U zc.buildout
Collecting zc.buildout
Downloading zc.buildout-3.0.1-py2.py3-none-any.whl.metadata (24 kB)
Collecting setuptools>=8.0 (from zc.buildout)
Downloading setuptools-70.0.0-py3-none-any.whl.metadata (5.9 kB)
Requirement already satisfied: pip in ./lib/python3.12/site-packages (from zc.buildout) (24.0)
Requirement already satisfied: wheel in ./lib/python3.12/site-packages (from zc.buildout) (0.43.0)
Downloading zc.buildout-3.0.1-py2.py3-none-any.whl (168 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168.4/168.4 kB 3.3 MB/s eta 0:00:00
Downloading setuptools-70.0.0-py3-none-any.whl (863 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 863.4/863.4 kB 12.5 MB/s eta 0:00:00
Installing collected packages: setuptools, zc.buildout
Successfully installed setuptools-70.0.0 zc.buildout-3.0.1
[myusername zope5100]$ bin/pip install pillow
Collecting pillow
Downloading pillow-10.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.2 kB)
Downloading pillow-10.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 16.8 MB/s eta 0:00:00
Installing collected packages: pillow
Successfully installed pillow-10.3.0
[myusername zope5100]$ bin/pip install mysqlclient
Collecting mysqlclient
Downloading mysqlclient-2.2.4.tar.gz (90 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 kB 1.7 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (pyproject.toml) ... done
Created wheel for mysqlclient: filename=mysqlclient-2.2.4-cp312-cp312-linux_x86_64.whl size=129310 sha256=d48a41af16e4aa59f8305a6b7e023456b98cac550203aea24f61cadf530ab8af
Stored in directory: /home/myusername/.cache/pip/wheels/20/6f/c3/3b23bb01988b1c0bea0668e2116315ce43ced2179724ab593e
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.2.4
[myusername zope5100]$ bin/buildout
Traceback (most recent call last):
File "/home/myusername/apps/zope5plus/zope5100/bin/buildout", line 5, in
from zc.buildout.buildout import main
File "/home/myusername/apps/zope5plus/zope5100/lib/python3.12/site-packages/zc/buildout/buildout.py", line 18, in
import zc.buildout.easy_install
File "/home/myusername/apps/zope5plus/zope5100/lib/python3.12/site-packages/zc/buildout/easy_install.py", line 28, in
from pkg_resources import packaging
ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/myusername/apps/zope5plus/zope5100/lib/python3.12/site-packages/pkg_resources/init.py)

I forgot, here is my buildout.cfg:

[buildout]
extends =
https://zopefoundation.github.io/Zope/releases/5.10/versions-prod.cfg
parts =
zopescripts

[zopescripts]
recipe = zc.recipe.egg
interpreter = zopepy
eggs =
Zope
Paste