Open shalak opened 2 months ago
systems: Ubuntu Budgie on a desktop, Ubuntu 24.04 on a laptop Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble
any command to do with thefuck or fuck triggers this
$ thefuck --version
Traceback (most recent call last):
File "/home/stan/.local/bin/thefuck", line 5, in <module>
from thefuck.entrypoints.main import main
File "/home/stan/.local/lib/python3.12/site-packages/thefuck/entrypoints/main.py", line 8, in <module>
from .. import logs # noqa: E402
^^^^^^^^^^^^^^^^^^^
File "/home/stan/.local/lib/python3.12/site-packages/thefuck/logs.py", line 8, in <module>
from .conf import settings
File "/home/stan/.local/lib/python3.12/site-packages/thefuck/conf.py", line 1, in <module>
from imp import load_source
ModuleNotFoundError: No module named 'imp'
same issue as og post
Clean install of Nobel does the same. I can't get PIP3 to install thefuck.
Says the same error as the bottom half of the OP post.
Install it with pip directly from this repo: pip install git+https://github.com/nvbn/thefuck
As you can see is https://github.com/nvbn/thefuck/blob/master/thefuck/conf.py updated using importlib
$ pip install git+https://github.com/nvbn/thefuck
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
Would need to put it in virtualenv :/
I managed to install it by passing the --break-system-packages
flag, but then it throws another error no module named 'imp'
I encountered the same issue when running the command:
thefuck --version
I received the following traceback:
Traceback (most recent call last):
File "/home/tekylo/.local/bin/thefuck", line 5, in <module>
from thefuck.entrypoints.main import main
ModuleNotFoundError: No module named 'thefuck'
It seems like the module is not being found. Any insights on how to resolve this?
I had the same error. I had installed on Ubuntu 22.04 with py3.10. When I upgraded to 24.04, python also got upgraded to 3.12 and that environment did not have thefuck installed. On Friday, 30 August 2024 at 12:52, José Antonio López Molina @.***> wrote:
I encountered the same issue when running the command:
thefuck --version
I received the following traceback:
Traceback (most recent call last): File "/home/tekylo/.local/bin/thefuck", line 5, in
from thefuck.entrypoints.main import main ModuleNotFoundError: No module named 'thefuck' It seems like the module is not being found. Any insights on how to resolve this?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Install it with pip directly from this repo:
pip install git+https://github.com/nvbn/thefuck
As you can see is https://github.com/nvbn/thefuck/blob/master/thefuck/conf.py updated using importlib
This method, but using pip3 install --user git+https://github.com/nvbn/thefuck
fixed it for me, for now.
I tried like this, no luck:
$ pipx install thefuck --force --include-deps
Installing to existing venv 'thefuck'
⚠️ Note: thefuck was already on your PATH at /usr/bin/thefuck
installed package thefuck 3.32, installed using Python 3.12.3
These apps are now globally available
- fuck
- thefuck
done! ✨ 🌟 ✨
$ fuck
Traceback (most recent call last):
File "/home/shalak/.local/bin/fuck", line 5, in <module>
from thefuck.entrypoints.not_configured import main
File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/entrypoints/not_configured.py", line 2, in <module>
from ..system import init_output
File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/system/__init__.py", line 7, in <module>
from .unix import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^
File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/system/unix.py", line 6, in <module>
from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils'
$ pipx install distutils
Fatal error from pip prevented installation. Full pip output in file:
/home/shalak/.local/state/pipx/log/cmd_2024-08-31_09.00.46_pip_errors.log
Some possibly relevant errors from pip install:
ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils
Error installing distutils.
$ pipx install setuptools
No apps associated with package setuptools or its dependencies. If you are attempting to install a library, pipx should not be used. Consider using pip or a similar tool instead.
pip3 uninstall thefuck pip3 install --user git+https://github.com/nvbn/thefuck --break-system-packages
Worked for me On Saturday, 31 August 2024 at 12:33, Mirek @.***> wrote:
I tried like this, no luck:
$ pipx install thefuck --force --include-deps Installing to existing venv 'thefuck' ⚠️ Note: thefuck was already on your PATH at /usr/bin/thefuck installed package thefuck 3.32, installed using Python 3.12.3 These apps are now globally available
- fuck
- thefuck done! ✨ 🌟 ✨ $ fuck Traceback (most recent call last): File "/home/shalak/.local/bin/fuck", line 5, in
from thefuck.entrypoints.not_configured import main File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/entrypoints/not_configured.py", line 2, in from ..system import init_output File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/system/init.py", line 7, in from .unix import * # noqa: F401,F403 ^^^^^^^^^^^^^^^^^^^ File "/home/shalak/.local/share/pipx/venvs/thefuck/lib/python3.12/site-packages/thefuck/system/unix.py", line 6, in from distutils.spawn import find_executable ModuleNotFoundError: No module named 'distutils' $ pipx install distutils Fatal error from pip prevented installation. Full pip output in file: /home/shalak/.local/state/pipx/log/cmd_2024-08-31_09.00.46_pip_errors.log Some possibly relevant errors from pip install: ERROR: Could not find a version that satisfies the requirement distutils (from versions: none) ERROR: No matching distribution found for distutils
Error installing distutils. $ pipx install setuptools
No apps associated with package setuptools or its dependencies. If you are attempting to install a library, pipx should not be used. Consider using pip or a similar tool instead.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
pip3 uninstall thefuck pip3 install --user git+nvbn/thefuck --break-system-packages Worked for me
worked for me too, here without the linkifier:
pip3 install --user git+https://github.com/nvbn/thefuck --break-system-packages
Should we really be using --break-system-packages
? The whole point of it to not mess with the system installation of Python. It's clearly not recommended as an installation method. This seems unnecessarily dangerous...
Thoughts?
You're right. we need to be VERY careful using that option. In my opinion, it's fine in this case because:
thefuck
doesn't overwrite an existing system packagerequirements.txt
specifies a version for only one package: setup-tools
, and it is a >=
type so it is likely fine in py3.12Still, it's good to be clear about these reasons, so thanks for bringing it up.
The output of
thefuck --version
(something likeThe Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release
):Cannot check
Your system (Debian 7, ArchLinux, Windows, etc.):
Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble
How to reproduce the bug:
The output of The Fuck with
THEFUCK_DEBUG=true
exported (typically executeexport THEFUCK_DEBUG=true
in your shell before The Fuck):Anything else you think is relevant:
I updated from Ubuntu 22 to 24 and now
thefuck
doesn't work due to missingimp
inpython3.12.3