Pipx: ensurepath creates double entries in the path

Created on 3 Feb 2020  路  5Comments  路  Source: pipxproject/pipx

Hi guys, I run into a potential problem w/ the command

$ pipx ensurepath

More context:

  • OS: macOS Catalina 10.15.2
  • Shell: zsh 5.7.1

Describe the bug
When I run ensurepath the path $HOME/.local/bin is inserted twice both in .zshrc and in .zprofile

Then, my path is polluted with doubled entries

<other_stuff>:/Users/myuser/.local/bin:/Users/myuser/.local/bin

How to reproduce

$ python -m pip install pipx
$ pipx ensurepath

Expected behavior
Just one entry of /Users/myuser/.local/bin should be added to the path.

upstream

All 5 comments

Same on Windows 10

Saw the same with several dozen entries in my system PATH being duplicated into my user PATH.

The cause is actually a bug in the userpath library used by pipx. I've opened an issue here:
https://github.com/ofek/userpath/issues/23

EDIT: Above only applies to Windows, but a similar bug may be present in the equivalent Unix handling within the same library.

@ciarancourtney @ralish Windows is fixed in 1.4.0 (see https://github.com/ofek/userpath/pull/24)

The OP's issue is different https://github.com/ofek/userpath/issues/3#issuecomment-512928319

Confirming this is fixed (on Windows) with userpath 1.4.0. Thanks @ofek!

Not fixed for macOS

Was this page helpful?
0 / 5 - 0 ratings