message_about_scripts_not_on_PATH does not expanduser()
See original GitHub issueEnvironment
- pip version: 18.1
- Python version: 3.7
- OS: Fedora 29
from python3-pip-18.1-1.fc29.noarch
Description
I was trying to install PyGitUp with pip3 install --user git-up
and ran into an issue where I was warned:
The script git-up is installed in '/home/jflorian/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
I callled BS because I knew this was on my PATH. But then I noticed my PATH actually had ~/.local/bin
and not /home/jflorian/.local/bin
as claimed. I looked at wheel.py
where the error originates and sure enough, there was no usage of os.path.expanduser()
. I changed my PATH to have this already expanded and the error message disappeared.
Expected behavior Most tools seem to know how to expand the tilde in my PATH, I would expect Pip to do so as well.
How to Reproduce
- export PATH with a local bin directory using a tilde, e.g.,
~/.local/bin
- Install any package with scripts using the
--user
option. - Observe the technically correct warning, but which is misleading w/o serious thought because it must be taken very literally and not as most users are likely to understand.
- Repeat with PATH having the tilde already expanded, e.g.,
/home/jflorian/.local/bin
and observe the behavior I’d expect in step 3.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Python | os.path.expanduser() method - GeeksforGeeks
expanduser() method in Python is used to expand an initial path component ~( tilde symbol) or ~user in the given path to user's...
Read more >Issue 39899: `pathlib.Path.expanduser()` does not call `os ...
expanduser() returns the path unchanged when a home directory cannot be resolved, pathlib.Path.expanduser() raises an error. The latter behavior ...
Read more >Why is os.path.expanduser not returning the home directory?
First, why might os.path.expanduser misbehave on certain systems, but not on others? Second, even if it's in the wrong directory, open() should ......
Read more >Replace os.getenv('HOME') with os.path.expanduser - 389-ds ...
When HOME env var is not set, the call will fail with an exception. ... The expanduser will do the right thing and...
Read more >click.Path expanduser · Issue #287 · pallets/click - GitHub
At this point I was not really thinking: is the command run through the shell or not. IMO click stands for usability. That's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What if we warn about this case if we see a path in PATH that starts with
~
? For example:Closed in #7345. Thanks @mdebi!