Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12.4: No module named 'imp' #1491

Open
Zero-Hub opened this issue Jan 9, 2025 · 7 comments
Open

Python 3.12.4: No module named 'imp' #1491

Zero-Hub opened this issue Jan 9, 2025 · 7 comments

Comments

@Zero-Hub
Copy link

Zero-Hub commented Jan 9, 2025

C:\Users\31009>fuck
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\31009\AppData\Local\Programs\Python\Python312\Scripts\fuck.exe_main.py", line 4, in
File "C:\Users\31009\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\entrypoints\not_configured.py", line 13, in
from .. import logs, const # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\31009\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\logs.py", line 8, in
from .conf import settings
File "C:\Users\31009\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\conf.py", line 1, in
from imp import load_source
ModuleNotFoundError: No module named 'imp'

@tokuchan
Copy link

Python has removed imp as of python 3.12. C.f.: https://docs.python.org/3/library/imp.html for details. They suggest using importlib instead.

@gokulcoder7
Copy link

C:\Users\Sushant>fuck
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\Sushant\AppData\Roaming\Python\Python312\Scripts\fuck.exe_main
.py", line 4, in
File "C:\Users\Sushant\AppData\Roaming\Python\Python312\site-packages\thefuck\entrypoints\not_configured.py", line 13, in
from .. import logs, const # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Sushant\AppData\Roaming\Python\Python312\site-packages\thefuck\logs.py", line 8, in
from .conf import settings
File "C:\Users\Sushant\AppData\Roaming\Python\Python312\site-packages\thefuck\conf.py", line 1, in
from imp import load_source
ModuleNotFoundError: No module named 'imp'

i also have same error

@Paul-16098
Copy link

me too:

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\p\AppData\Roaming\Python\Python313\Scripts\thefuck.exe\__main__.py", line 4, in <module>
    from thefuck.entrypoints.main import main
  File "C:\Users\p\AppData\Roaming\Python\Python313\site-packages\thefuck\entrypoints\main.py", line 8, in <module>
    from .. import logs  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\p\AppData\Roaming\Python\Python313\site-packages\thefuck\logs.py", line 8, in <module>
    from .conf import settings
  File "C:\Users\p\AppData\Roaming\Python\Python313\site-packages\thefuck\conf.py", line 1, in <module>
    from imp import load_source
ModuleNotFoundError: No module named 'imp'

@manavortex
Copy link

fixed in this pull request: #1483

@TDGalea
Copy link

TDGalea commented Jan 30, 2025

fixed in this pull request: #1483

Huge thanks for this. Until (or even if) this is merged, I've manually updated the two problematic files (conf.py and types.py).

For reference, using The Fuck 3.32 on Python 3.12.3, freshly installed via pip.

@matteohoeren
Copy link

@manavortex Thanks for the fix, i had to apply it locally as well :D

@freckhard
Copy link

Many thanks @TDGalea, quickly replacing your listed files from #1491 (comment) solved my issue instantly. Hope the PR gets integrated quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants