Description of problem: Update operation's result is ignored. Version-Release number of components: python2-pip.noarch 9.0.3-1.fc28 @fedora, python3-pip.noarch 9.0.3-1.fc28 @fedora. Steps to Reproduce: 1. Assumed that some Python packages are non-updated; Verify as follow: $ pip list --outdated ... pip (9.0.3) - Latest: 10.0.1 [wheel] ... 2. $ pip install --user -U pip Collecting pip Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB) ... Successfully installed pip-10.0.1 You are using pip version 9.0.3, however version 10.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 3. $ pip install --user --upgrade pip Traceback (most recent call last): File "/usr/bin/pip", line 7, in <module> from pip import main ImportError: cannot import name main Actual results: As noticeable in step 2., output does assume pip version is still in state non-updated. Expected results: Pip to be aware of its own operations. Additional information: –After update took place– $ dnf list installed|grep -i pip ... python2-pip.noarch 9.0.3-1.fc28 @fedora python3-pip.noarch 9.0.3-1.fc28 @fedora
$ sudo pip install --upgrade pip WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead. ... Successfully uninstalled pip-9.0.3 Successfully installed pip-10.0.1
As a workaround, you can use the pip module instead of calling "pip" directly: $ python -m pip list --outdated
This bug is caused by the fact that you don't have ~/.local/bin in your $PATH. Therefore you install new pip sources into your home directory, but you're still using the old access point at /usr/bin/pip that does not work with the new sources. We can solve this by patching /usr/bin/pip to also look for the new sources, which would be an ugly downstream hack that fixes only this case. The better solution would be to add ~/.local/bin to the default $PATH. I don't understand why it's not there already. Does anyone have an idea as to why?
Hm, so I've verified that ~/.local/bin indeed is in the default $PATH. Ricky, I believe you have modified your $PATH and now it doesn't contain ~/.local/bin. If you want modules that you pip-installed with --user to work, you need this location in your $PATH.
Only changes have been made here: $ gedit &>/dev/null ~/.bashrc # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions export EDITOR=/usr/bin/gedit # Aliasten käyttöönotto alias aliasko='source ~/.bashrc' ... more aliases.
Aha! Apologies, it turns out /usr/bin takes precedence over ~/.local/bin in the default Fedora PATH and this is causing the issue. $ echo $PATH /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/tom/.local/bin:/home/tom/bin
Where is the PATH actually coming from? $ mock -r fedora-rawhide-x86_64 --shell <mock-chroot> sh-4.4# echo $PATH /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin <mock-chroot> sh-4.4# adduser foo <mock-chroot> sh-4.4# su foo <mock-chroot> bash-4.4$ echo $PATH /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
$ echo $PATH /usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/yk/.local/bin:/home/yk/bin
(In reply to Miro Hrončok from comment #7) > Where is the PATH actually coming from? > > $ mock -r fedora-rawhide-x86_64 --shell > <mock-chroot> sh-4.4# echo $PATH > /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin > <mock-chroot> sh-4.4# adduser foo > <mock-chroot> sh-4.4# su foo > <mock-chroot> bash-4.4$ echo $PATH > /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin You need to start the user's shell as a login shell (su - foo) to get the full $PATH: sh-4.4# adduser foo sh-4.4# su - foo [foo@78595df164a54336b3cd6d4c10e5e017 ~]$ echo $PATH /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/foo/.local/bin:/home/foo/bin However, I spent some time looking through ~/.bashrc, /etc/bashrc, /etc/profile, and /etc/profile.d/ and I was not able to find out where ~/.local/bin is added to $PATH. There is a function for adding PATH elements called `pathmunge`, but nowhere have I found the ~/.local/bin being added.
[Facepalm] Found it! In ~/.bash_profile: # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin By changing it to: PATH=$HOME/.local/bin:$HOME/bin:$PATH We get the desired ordering: $ echo $PATH /home/foo/.local/bin:/home/foo/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin Now the dilemma, is there a reason we shouldn't do this? Should system binaries always have preference over user installed ones? We can rule out malicious usage, because if someone has access to ~/.local/bin, they can also permanently rewrite $PATH as well. Besides that, if the user wants to install a newer version locally, I say they should be allowed.
~/.bash_profile gets created as a copy of /etc/skel/.bash_profile that is owned by the bash package.
Let's ask the bash maintainers if we can change the order. It would solve this issue. At least for new installs / users. Also I'd except that any layer closer to **me** (the user) should have precedence, i.e. IMHO: 1. /usr/local/bin should beat /usr/bin 2. ~/.local/bin should beat /usr/local/bin
For the reference, adding ~/.local/bin was previously discussed in this thread[1] and it was added in $PATH based on request by one users[2]. I think we should discuss the change to prepend this path in fedora-devel first and change it only if there is a concrete reason to do so. [1] https://lists.fedoraproject.org/pipermail/devel/2011-July/154896.html [2] https://bugzilla.redhat.com/show_bug.cgi?id=699812
> Now the dilemma, is there a reason we shouldn't do this? Should system binaries always have preference over user installed ones? No.
> I think we should discuss the change to prepend this path in fedora-devel first If we must :) > change it only if there is a concrete reason to do so This bug is a concrete reason to do so.
I'll send an email to fedora-devel.
Miro, Neither OpenSuse nor Ubuntu add ~/.local/bin in $PATH. It was added as a response to request from one user and should not have been added without some discussion. If a user is installing something in non-standard paths, they should be responsible for setting $PATH to find correct commands.
Email thread here: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/OXXC5NOZP37W2F6GHV6P5E6K22QHOBNJ/
Siteshwar, >If a user is installing something in non-standard paths, they should be responsible for setting $PATH to find correct commands. Nowadays, a lot of tools like pip, bundler, and npm assume ~/.local to be the private copy of the LSB FSH standard directories. It was started by Gnome, Though it's not the standard, the adoption is slowly starting to increase.
(In reply to Siteshwar Vashisht from comment #17) > If a user is installing something in non-standard paths, > they should be responsible for setting $PATH to find correct commands. ~/.local/bin is quite standard and I'd say XDG complaint. That's what Lennart Poettering said in https://bugzilla.redhat.com/show_bug.cgi?id=699812#c2 and I agree with him.
> ~/.local/bin is quite standard and I'd say XDG complaint. That's what Lennart Poettering said in https://bugzilla.redhat.com/show_bug.cgi?id=699812#c2 and I agree with him. Lennart later clarified his comment[1]. [1] https://lists.fedoraproject.org/pipermail/devel/2011-July/154902.html
Yet I still consider ~/.local/bin "standard practice". Let's continue on devel ML.
*** Bug 1569488 has been marked as a duplicate of this bug. ***
python-pip-9.0.3-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f
python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f
python-pip-9.0.3-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0
python-pip-9.0.3-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c
python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0
python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c
python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.