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

I get a error when i run fuck command in windows, installed fuck with pip #1460

Open
arsalanmohseni opened this issue Aug 27, 2024 · 3 comments · May be fixed by #1475
Open

I get a error when i run fuck command in windows, installed fuck with pip #1460

arsalanmohseni opened this issue Aug 27, 2024 · 3 comments · May be fixed by #1475

Comments

@arsalanmohseni
Copy link

The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):

Traceback (most recent call last):

File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\mardin it\AppData\Local\Programs\Python\Python312\Scripts\thefuck.exe_main
.py", line 4, in
File "C:\Users\mardin it\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\entrypoints\main.py", line 8, in
from .. import logs # noqa: E402
^^^^^^^^^^^^^^^^^^^
File "C:\Users\mardin it\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\logs.py", line 8, in
from .conf import settings
File "C:\Users\mardin it\AppData\Local\Programs\Python\Python312\Lib\site-packages\thefuck\conf.py", line 1, in
from imp import load_source
ModuleNotFoundError: No module named 'imp'

Your system (Debian 7, ArchLinux, Windows, etc.):

Windows 11

How to reproduce the bug:

No idea

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck):

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

If the bug only appears with a specific application, the output of that application and its version:

Its doesn't work anywhere
@FlamingPhoenix40
Copy link

Ran into the same issue today myself. I assume you are running Python 3.12? From what I can tell from here on Stackoverflow, imp is deprecated and removed in 3.12. thefuck would need to be updated to remove that dependency. As an intermediate solution you could switch to Python 3.11 until thefuck gets fixed, if you don't specifically need Python 3.12.

@FidelSch
Copy link

There is a solution on #1449 , for Linux at least
Worked for me on Ubuntu 24
If I were you I'd try to find the equivalent file on Windows

@arsalanmohseni
Copy link
Author

Ran into the same issue today myself. I assume you are running Python 3.12? From what I can tell from here on Stackoverflow, imp is deprecated and removed in 3.12. thefuck would need to be updated to remove that dependency. As an intermediate solution you could switch to Python 3.11 until thefuck gets fixed, if you don't specifically need Python 3.12.

I have python 3.12 and i need it too

@arsalanmohseni arsalanmohseni closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
@arsalanmohseni arsalanmohseni reopened this Sep 8, 2024
@DJStompZone DJStompZone linked a pull request Oct 2, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants