I think that I have bigger issues (the above patch should still be useful):
File "/usr/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py", line 12, in <module>
import setuptools
File "/usr/lib/python3.12/site-packages/setuptools/__init__.py", line 7, in <module>
import _distutils_hack.override # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/_distutils_hack/override.py", line 1, in <module>
__import__('_distutils_hack').do_override()
File "/usr/lib/python3.12/site-packages/_distutils_hack/__init__.py", line 77, in do_override
ensure_local_distutils()
File "/usr/lib/python3.12/site-packages/_distutils_hack/__init__.py", line 60, in ensure_local_distutils
importlib.import_module('distutils')
File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1322, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1262, in _find_spec
File "/usr/lib/python3.12/site-packages/_distutils_hack/__init__.py", line 97, in find_spec
return method()
^^^^^^^^
File "/usr/lib/python3.12/site-packages/_distutils_hack/__init__.py", line 128, in spec_for_distutils
return importlib.util.spec_from_loader(
^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'util'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 17, in __PYTHON_EL_eval
File "examples/my_code.py", line 587, in <module>
V_cg_vec = fem.functionspace(domain, Ve_cg_vec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/dolfinx/fem/function.py", line 655, in functionspace
(ufcx_element, ufcx_dofmap), module, code = jit.ffcx_jit(
^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/dolfinx/jit.py", line 51, in mpi_jit
return local_jit(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/dolfinx/jit.py", line 203, in ffcx_jit
r = ffcx.codegeneration.jit.compile_elements([ufl_object], options=p_ffcx, **p_jit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/ffcx/codegeneration/jit.py", line 205, in compile_elements
raise e
File "/usr/lib/python3.12/site-packages/ffcx/codegeneration/jit.py", line 185, in compile_elements
impl = _compile_objects(
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/ffcx/codegeneration/jit.py", line 416, in _compile_objects
ffibuilder.compile(tmpdir=cache_dir, verbose=True, debug=cffi_debug)
File "/usr/lib/python3.12/site-packages/cffi/api.py", line 725, in compile
return recompile(self, module_name, source, tmpdir=tmpdir,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/cffi/recompiler.py", line 1546, in recompile
ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/cffi/ffiplatform.py", line 9, in get_extension
from cffi._shimmed_dist_utils import Extension
File "/usr/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py", line 16, in <module>
raise Exception("This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.") from ex
Exception: This CFFI feature requires setuptools on Python >= 3.12. The setuptools module is missing or non-functional.