Comments (5)
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.
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.
yooo, same shit happens to me
from thefuck.
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.
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)
- Unhandled `apt` "Packages were downgraded and -y was used without --allow-downgrades" error
- Support for Windows CMD HOT 4
- /.zshrc:1: command not found: thefuck HOT 3
- Shell slow to start with `eval "$(thefuck --alias)"`, workaround is a lazy loading trick HOT 1
- Fuck command does not work on Alacritty (Mint) HOT 1
- When using Windows Terminal to ssh to a remote server with Zsh/OMZ/powerlevel10k, and instant mode in ~/.zshrc, sometimes crash on start up.
- Help for installing on windows HOT 4
- ModuleNotFoundError: No module named 'imp' when running 'fuck' HOT 14
- Error in building development container
- Feature Request: Instant-Interactive Mode + Zoxide with FZF HOT 1
- Compatibility with pytest 8
- apt command completion error
- Alternative Exit sequence? HOT 1
- Doesn't work in nushell (sees it as generic shell) HOT 1
- [Suggestion]
- "imp" module removed in python 3.12 HOT 1
- Thefuck with Python 3.12.x HOT 3
- Thefuck 3.32 issue on Fedora 40
- Having a hard time getting set up on Ubuntu 24.04 HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thefuck.