The deprecated imp module was removed in Python 3.12.
Why it happens
imp was deprecated since Python 3.4 and removed in 3.12. A dependency or your own code still imports it.
How to fix it
Replace `imp` with `importlib` — e.g. `importlib.util.find_spec`, `importlib.import_module`, `importlib.machinery` instead of `imp.find_module` / `imp.load_module`.
Upgrade any third-party package that still imports imp to a current release.