nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
84.95k stars 3.43k forks source link

Ubuntu installation instructions no longer work #1391

Open rzach opened 1 year ago

rzach commented 1 year ago

On Ubuntu 23.04 I get the following error when I try pip3 install thefuck --user

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.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

(I did manage to install it using pipx install thefuck.)

yalattas commented 1 year ago

I used pip3 install thefuck --user as well as pip3 install thefuck --user on ubutnu 22.04 and terminal didn't recognize the command

I added the following on my ~/.zshrc with no luck

eval $(thefuck --alias)
eval $(thefuck --alias FUCK)
alias f="fuck"

OS:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy
vandorb12 commented 10 months ago

Apparently, apt now has thefuck available as a package to install sudo apt-get install thefuck You still have to make an edit to your shell profile to add the alias, but it's so much easier than dealing with the nuisance of setting up a virtual python environments these newer versions of python scream for.

gisostallenberg commented 5 months ago

I like the apt way better, but otherwise one could run

pipx install thefuck

given that pipx is available (or run sudo apt-get install pipx, to make it available).