pipx icon indicating copy to clipboard operation
pipx copied to clipboard

Global parameter does not work using ensurepath command

Open marcosalberto opened this issue 1 year ago • 4 comments

Describe the bug

Follow the pipx install documentation for MacOS causes a "unrecognized arguments" error on ensurepath command.

How to reproduce

➜ ~ sudo pipx ensurepath --global Password: usage: pipx [-h] [--quiet] [--verbose] [--global] [--version] {install,uninject,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,interpreter,run,runpip,ensurepath,environment,completions} ... pipx: error: unrecognized arguments: --global ➜ ~

Expected behavior

Install pipx globally without errors

marcosalberto avatar Apr 10 '24 14:04 marcosalberto

Hi @marcosalberto, could you please provide the version of pipx you are on?

Edit: I just saw your PR. Does setting --global right after pipx instead of after ensurepath fix it for you?

Gitznik avatar Apr 10 '24 15:04 Gitznik

Hi @Gitznik,

I'm using the 1.5.0 version and change the parameter position fixes the issue.

➜  ~ pipx --version
1.5.0

Sorry by didn't add a comment making reference to the PR.

marcosalberto avatar Apr 10 '24 15:04 marcosalberto

Ah, I just installed pipx for the first time and caught this.

This works.

sudo pipx --global ensurepath

This doesn't work

sudo pipx ensurepath --global

boris-ning-usds avatar Apr 10 '24 19:04 boris-ning-usds

Same issue here, exactly as @boris-ning-usds described.

Radiergummi avatar Apr 17 '24 09:04 Radiergummi

Will work as described in the documentation in the upcoming pipx version (#1397).

chrysle avatar May 11 '24 15:05 chrysle

i have issue with ~ ❯ sudo pipx --global ensurepat usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions} ... pipx: error: argument command: invalid choice: 'ensurepat' (choose from 'install', 'inject', 'upgrade', 'upgrade-all', 'uninstall', 'uninstall-all', 'reinstall', 'reinstall-all', 'list', 'run', 'runpip', 'ensurepath', 'completions')

and ~ ❯ sudo pipx ensurepath --global ✘ 2 usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions} ... pipx: error: unrecognized arguments: --global

salko-ua avatar May 31 '24 08:05 salko-ua

i have issue with ~ ❯ sudo pipx --global ensurepat usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions} ... pipx: error: argument command: invalid choice: 'ensurepat' (choose from 'install', 'inject', 'upgrade', 'upgrade-all', 'uninstall', 'uninstall-all', 'reinstall', 'reinstall-all', 'list', 'run', 'runpip', 'ensurepath', 'completions')

there's a typo in ensurepath

Gitznik avatar May 31 '24 09:05 Gitznik

I have the same issue: sudo pipx --global ensurepath usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions} ... pipx: error: unrecognized arguments: --global

sudo pipx ensurepath --global usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions} ... pipx: error: unrecognized arguments: --global

BurninChrome avatar Jun 10 '24 09:06 BurninChrome

I have the same issue: sudo pipx --global ensurepath usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions} ... pipx: error: unrecognized arguments: --global

sudo pipx ensurepath --global usage: pipx [-h] [--version] {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions} ... pipx: error: unrecognized arguments: --global

Which version of pipx are you on? (pipx --version)

Gitznik avatar Jun 10 '24 12:06 Gitznik

I had the same error with pipx 1.0.0 none of the following work:

pipx --global ensurepath
pipx ensurepath --global
# neither of these with sudo

I followed docs for ubuntu installation and ended up with 1.0.0, when the latest is 1.6.0 🤷‍♂️

Fix:

sudo apt install python3-pip -y #skip this step if pip is already installed
python3 -m pip install --user --upgrade pipx
sudo pipx ensurepath --global

gundeep-dialpad avatar Jun 10 '24 20:06 gundeep-dialpad

I followed docs for ubuntu installation and ended up with 1.0.0, when the latest is 1.6.0 🤷‍♂️

Yes, unfortunately the pipx version bundled for ubuntu is massively outdated (see here), and the --global flag was not around in version 1.0.

Gitznik avatar Jun 11 '24 07:06 Gitznik

Should we suggest to use pipx-managed pipx as discussed here: https://github.com/pypa/pipx/discussions/1341 ?

IMO, it works quite well for me on Linux/Mac/Windows.

huxuan avatar Jun 11 '24 11:06 huxuan

Should we suggest to use pipx-managed pipx as discussed here: #1341 ?

IMO, it works quite well for me on Linux/Mac/Windows.

Mind opening a new issue for this?

Gitznik avatar Jun 11 '24 11:06 Gitznik

Mind opening a new issue for this?

Here we go: https://github.com/pypa/pipx/issues/1449

huxuan avatar Jun 11 '24 12:06 huxuan