Code Monkey home page Code Monkey logo

Comments (5)

specarino avatar specarino commented on June 7, 2024 2

According to PEP 632, distutils has been removed from Python 3.12.

A band-aid fix for us users for now would be to follow the above report and just install the python-setuptools package.

Edit: #1404 and/or #1247 appears to fix this, but they are still open PRs

from thefuck.

MiguelGuthridge avatar MiguelGuthridge commented on June 7, 2024 1

I installed with pipx, and found that I still ended up with an error even after running pipx inject thefuck distutils.

Traceback (most recent call last):
  File "/home/migue/.local/bin/thefuck", line 5, in <module>
    from thefuck.entrypoints.main import main
  File "/home/migue/.local/pipx/venvs/thefuck/lib64/python3.12/site-packages/thefuck/entrypoints/main.py", line 8, in <module>
    from .. import logs  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^
  File "/home/migue/.local/pipx/venvs/thefuck/lib64/python3.12/site-packages/thefuck/logs.py", line 8, in <module>
    from .conf import settings
  File "/home/migue/.local/pipx/venvs/thefuck/lib64/python3.12/site-packages/thefuck/conf.py", line 1, in <module>
    from imp import load_source
ModuleNotFoundError: No module named 'imp'

Looks like getting thefuck to work nicely with Python 3.12 may be a little more painful than just adding a missing dependency, since I can't find any drop-in replacement for imp (which has been deprecated since Python 3.4, and got removed in Python 3.12, source).

The easiest solution for pipx users is to stick to Python 3.11. For me, this was as simple as

$ sudo dnf install python3.11  # changes depending on your distro
$ pipx reinstall --python python3.11 thefuck

from thefuck.

GetInIHaveCandy0 avatar GetInIHaveCandy0 commented on June 7, 2024

yooo, same shit happens to me

from thefuck.

pynmash avatar pynmash commented on June 7, 2024

I did a little research before coming here and discovered the same fix.
It's been a while since the last commit. Hope the project isn't abandoned

from thefuck.

tyush avatar tyush commented on June 7, 2024

Same issue with me. If you use pipx but don't want to downgrade your system Python version (dangerous if tools from your distro rely on system Python), the following command installs thefuck into a venv with Python 3.11 while keeping the system Python untouched.

$ pipx install --fetch-missing-python --python "3.11" thefuck
$ thefuck --help
usage: thefuck [-v] [-a [ALIAS]] [-l SHELL_LOGGER]
...
$ python --version
Python 3.12.3

from thefuck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.