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

ModuleNotFoundError: No module named 'imp' when running 'fuck' #1434

Open
D-Sensei opened this issue Feb 12, 2024 · 10 comments
Open

ModuleNotFoundError: No module named 'imp' when running 'fuck' #1434

D-Sensei opened this issue Feb 12, 2024 · 10 comments

Comments

@D-Sensei
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):

Package Version: 'thefuck' version 3.32

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

Windows 11

How to reproduce the bug:

1. Install the 'thefuck' package using pip. 
2. Attempt to run the 'fuck' command in the terminal.

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

    C:\Users\D-Sensei>set THEFUCK_DEBUG=true
    C:\Users\D-Sensei>fuck --debug
    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\D
      Sensei\AppData\Roaming\Python\Python312\Scripts\fuck.exe\__main__.py", line 4, in
      <module>
      File "C:\Users\D-Sensei\AppData\Roaming\Python\Python312\site
      packages\thefuck\entrypoints\not_configured.py", line 13, in <module>
        from .. import logs, const  # noqa: E402
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\D-Sensei\AppData\Roaming\Python\Python312\site
      packages\thefuck\logs.py", line 8, in <module>
        from .conf import settings
      File "C:\Users\D-Sensei\AppData\Roaming\Python\Python312\site
      packages\thefuck\conf.py", line 1, in <module>
        from imp import load_source
    ModuleNotFoundError: No module named 'imp'
    
    [!] the program is unable to find the 'imp' module, resulting in a `ModuleNotFoundError`. 
    This problem likely stems from a compatibility issue between'thefuck' and the Python
    version being used, or from a corrupted package installation

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

The bug prevents users from utilizing the 'thefuck' application as intended, impacting their
ability to correct previous console commands.

Anything else you think is relevant:

- The issue seems to be related to the 'thefuck' package's dependency on the 'imp' module,
which is not being recognized or found during execution.
- This error prevents the 'fuck' command from functioning as intended, affecting its usability
and functionality.
@Denny966
Copy link

Got the same issue :(

@ljgonzalez1
Copy link

+1

Running python 3.10
Do I need to install a library or something?

@yesseruser
Copy link

Same here, running Python 3.12

@artahadhahd
Copy link

artahadhahd commented Feb 21, 2024

The imp module has been removed in Python3.12 in favor of importlib.
Use a python version before 3.12, it might work.
Edit: should be fixed by this pull request #1415

@Denny966
Copy link

The imp module has been removed in Python3.12 in favor of importlib. Use a python version before 3.12, it might work. Edit: should be fixed by this pull request #1415

Works in python 3.11.8!

@KerickHowlett
Copy link

It's not working on the Python v3.12.2. :(

@yesseruser
Copy link

It's not working on the Python v3.12.2. :(

I'm quite sure they won't return that deprecated and removed library if there's another one we can use.

Too bad the maintainer/s are not doing anything about it; there's an open pull request for this, too

@trantuan-20048607
Copy link

Same here on Ubuntu 24.04 LTS. Python 3.12 is the default version installed by APT. (thefuck is also installed by sudo apt install thefuck)

@tes-balo
Copy link

This issue is still present Ubuntu 24.04, Python 312

@danthe1st
Copy link

@tes-balo I think this is already fixed in this repository but there was no release. You can try

pip uninstall thefuck
pip install https://github.com/nvbn/thefuck/archive/master.zip

See also #1415 (comment) and #1415 (comment)

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

9 participants