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 parameter does not work using ensurepath command #1337

Closed
marcosalberto opened this issue Apr 10, 2024 · 14 comments
Closed

Global parameter does not work using ensurepath command #1337

marcosalberto opened this issue Apr 10, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@marcosalberto
Copy link

marcosalberto commented Apr 10, 2024

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

@Gitznik
Copy link
Contributor

Gitznik commented Apr 10, 2024

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?

@marcosalberto
Copy link
Author

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.

@Gitznik Gitznik linked a pull request Apr 10, 2024 that will close this issue
1 task
@chrysle chrysle added the bug Something isn't working label Apr 10, 2024
@boris-ning-usds
Copy link

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

@Radiergummi
Copy link

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

@chrysle
Copy link
Contributor

chrysle commented May 11, 2024

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

@chrysle chrysle closed this as completed May 11, 2024
@salko-ua
Copy link

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

@Gitznik
Copy link
Contributor

Gitznik commented May 31, 2024

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

@BurninChrome
Copy link

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

@Gitznik
Copy link
Contributor

Gitznik commented Jun 10, 2024

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)

@gundeep-dialpad
Copy link

gundeep-dialpad commented Jun 10, 2024

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

@Gitznik
Copy link
Contributor

Gitznik commented Jun 11, 2024

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.

@huxuan
Copy link
Member

huxuan commented Jun 11, 2024

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

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

@Gitznik
Copy link
Contributor

Gitznik commented Jun 11, 2024

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?

@huxuan
Copy link
Member

huxuan commented Jun 11, 2024

Mind opening a new issue for this?

Here we go: #1449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants