Skip to content

pip install --user should check that the user's $PATH is correct #3813

@njsmith

Description

@njsmith

On Unix, pip install --user ... drops scripts into ~/.local/bin. Historically, this directory has not been on the default Debian/Ubuntu $PATH.

This is hopefully on its way to being fixed (bash 4.3-15 is on its way into Debian unstable now, and should hopefully land in Debian testing in a few weeks, bug report here; the Ubuntu bug that will hopefully be used to justify a backport of this fix into Xenial is here). But, even once the fix lands, all it will do is change the default for newly created accounts -- so for a long time, there are going to be people who try running pip install --user and end up with it dropping executables into a directory that's not on $PATH.

When pip install --user installs a script into ~/.local/bin (or the equivalent on other OSes, why not), then it should check the current os.environ["PATH"], and if this directory is not on the PATH, then it should print an explanatory message that warns the user and gives them some information on how to fix the problem.

(Or heck, it could even suggest they run pip fix-user-path to have pip automatically add tihs to their ~/.profile -- it's a little wonky but not too hard to make reasonably robust, and if it's a manual action that tells the user what it's doing as it runs then it should be reasonable helpful.)

(This would be a reasonable first fix for someone new to pip -- does pip's issue tracker have a tag for those?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-lockedOutdated issues that have been locked by automationtype: enhancementImprovements to functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions