Background
As the Python 3.14 became more and more popular, it is significant to support 3.12+ which abandoned imp.
Many people have already found this. I'm adding my voice to emphasize its importance.
What went wrong?
The Error says,
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\RoseGold\AppData\Local\Programs\Python\Python314\Scripts\fuck.exe\__main__.py", line 2, in <module>
from thefuck.entrypoints.not_configured import main
File "C:\Users\RoseGold\AppData\Local\Programs\Python\Python314\Lib\site-packages\thefuck\entrypoints\not_configured.py", line 13, in <module>
from .. import logs, const # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RoseGold\AppData\Local\Programs\Python\Python314\Lib\site-packages\thefuck\logs.py", line 8, in <module>
from .conf import settings
File "C:\Users\RoseGold\AppData\Local\Programs\Python\Python314\Lib\site-packages\thefuck\conf.py", line 1, in <module>
from imp import load_source
ModuleNotFoundError: No module named 'imp'
version:
Python 3.14.2
thefuck 3.32
The fix seems straightforward
Well, I have to acknowledge I don't know much about this. But AI told me that:
The imp module is deprecated and removed. Switching to importlib (e.g., importlib.machinery.SourceFileLoader) should resolve this.
Background
As the Python 3.14 became more and more popular, it is significant to support 3.12+ which abandoned
imp.Many people have already found this. I'm adding my voice to emphasize its importance.
What went wrong?
The Error says,
version:
Python 3.14.2
thefuck 3.32
The fix seems straightforward
Well, I have to acknowledge I don't know much about this. But AI told me that:
The
impmodule is deprecated and removed. Switching toimportlib(e.g.,importlib.machinery.SourceFileLoader) should resolve this.