File “/usr/local/lib/python3.12/ctypes/init.py”, line 8, in
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named ‘_ctypes’
The use of /usr/local suggests that this is a private build of python.
Given that I suspect whoever built that for you did not have all dependencies that python’s modules needs.
You should ask for a fix from the maintainer if that is the case.
Would I also be correct in guessing that your distro does not support python 3.12 yet?
I would guess it’s a custom CPython build and the ctypes module just wasn’t built, probably due to missing libffi. “./configure” script output could be helpful here.
You are both right. My distro is MX-Linux. The included Python is 3.9.
I did the build at 2024-04-27 so I don’t have got the output anymore.
Any hints for this situation?
Rebuild, with all required development libraries present, in this case specifically libffi
.