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

ensurepath creates double entries in the path #351

Closed
floatingpurr opened this issue Feb 3, 2020 · 9 comments
Closed

ensurepath creates double entries in the path #351

floatingpurr opened this issue Feb 3, 2020 · 9 comments
Labels
upstream Bug in dependency

Comments

@floatingpurr
Copy link

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.

@floatingpurr floatingpurr changed the title ensurepath creates double entries in the path 'pipx ensurepath' creates double entries in the path Feb 3, 2020
@floatingpurr floatingpurr changed the title 'pipx ensurepath' creates double entries in the path ensurepath creates double entries in the path Feb 3, 2020
@ciarancourtney
Copy link

Same on Windows 10

@ralish
Copy link

ralish commented May 9, 2020

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:
ofek/userpath#23

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

@ofek
Copy link
Contributor

ofek commented May 9, 2020

@ciarancourtney @ralish Windows is fixed in 1.4.0 (see ofek/userpath#24)

The OP's issue is different ofek/userpath#3 (comment)

@ralish
Copy link

ralish commented May 9, 2020

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

@itsayellow itsayellow added the upstream Bug in dependency label May 31, 2020
@floatingpurr
Copy link
Author

Not fixed for macOS

@dukecat0
Copy link
Member

dukecat0 commented Aug 1, 2022

@floatingpurr Do you still encounter this issue?

@floatingpurr
Copy link
Author

Hi @meowmeowmeowcat. To be honest, off the top of my head, I can't remember. Next time I'll check it out. However, this is an old issue. I guess that if anybody has experienced something similar anymore, everything should be fine now. I'm gonna close it for now. Thanx for asking.

@floatingpurr
Copy link
Author

floatingpurr commented Sep 2, 2022

Ok, just tried. When I run ensurepath, an entry like the following one:

# Created by `pipx` on 2022-09-02 09:58:37
export PATH="$PATH:/Users/floatingpurr/.local/bin"

is appended to both .zshrc and .zprofile.

Why do we need the export command repeated in .zprofile?

@floatingpurr floatingpurr reopened this Sep 2, 2022
@dukecat0
Copy link
Member

dukecat0 commented Sep 9, 2022

See ofek/userpath#3 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Bug in dependency
Projects
None yet
Development

No branches or pull requests

6 participants