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

Global installation of an application not recognizing pipx #919

Closed
ddeepwell opened this issue Nov 29, 2022 · 1 comment
Closed

Global installation of an application not recognizing pipx #919

ddeepwell opened this issue Nov 29, 2022 · 1 comment

Comments

@ddeepwell
Copy link

Describe the bug
The instructions to install an application globally from https://pypa.github.io/pipx/installation/ does not recognize pipx

How to reproduce
Here are the steps I took:

python3 -m pip install --user pipx
python3 -m pipx ensurepath
sudo PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install cowsay

Where the last command returns the error sudo: pipx: command not found

I am running on Rocky Linux 8

@hotenov
Copy link

hotenov commented Dec 22, 2022

@ddeepwel Hi! I don't know whether you need an explanation or not, but I'll write a little about it 😃 (for users who really need this command right now, and don't want to wait when issue will be resolved)

Sudo (root) user knows nothing about 'pipx' executable (where it's located). Compare output for two commands which pipx and sudo which pipx
First shows you path to pipx, something like that /home/username/.local/bin/pipx
Second shows you nothing (if pipx was not installed under root before)

As temporary workaround you can switch to root user preserving your current user environment (pipx executable is retained observable for root user)

sudo -Es

Then execute command from docs, without sudo (because you are already root), then exit from sudo shell i.e.

PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install cowsay
exit

To uninstall cowsay symlink and its venv you have to repeat this actions (pay attention this time uninstall command is used):

sudo -Es
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx uninstall cowsay
exit

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

3 participants