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

Latest pip 8.1.2 fails to upgrade on Ubuntu 16.04 #3776

Closed
sethmlarson opened this issue Jun 4, 2016 · 28 comments
Closed

Latest pip 8.1.2 fails to upgrade on Ubuntu 16.04 #3776

sethmlarson opened this issue Jun 4, 2016 · 28 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@sethmlarson
Copy link
Contributor

sethmlarson commented Jun 4, 2016

  • Pip version: 8.1.1
  • Python version: 3.5
  • Operating System: Ubuntu 16.04

Description:

Tried to upgrade pip 8.1.1 to 8.1.2 for Python 3.5, downloaded the wheel for pip 8.1.2, but still displays version of pip as 8.1.1. This happens regardless of if I remove cache or used the cached wheel. Many others are having a similar problem: http://askubuntu.com/questions/775942/latest-python-pip-with-u16-04

What I've run:

$ python3.5 -m pip install --upgrade pip
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@njsmith
Copy link
Member

njsmith commented Jun 5, 2016

Can you re-test this and paste the full commands you ran and their output, and why you think you don't have pip 8.1.2? I just tried running this command locally, and I got:

njs@a08469421425:~$ pip3 install -U pip
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |################################| 1.2MB 787kB/s 
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
njs@a08469421425:~$ pip3 install -U pip
Requirement already up-to-date: pip in ./.local/lib/python3.5/site-packages
njs@a08469421425:~$ pip3 --version
pip 8.1.2 from /home/njs/.local/lib/python3.5/site-packages (python 3.5)

So I got the same output, but pip was in fact upgraded to 8.1.2. (It's definitely a bug that it said "successfully installed pip-8.1.1" -- I have no idea what's up with that, someone who knows pip better than me might. And probably it should be considered a bug that after upgrading pip, pip complains about being an old version -- but this is just confusing, not actually a problem, what pip is saying is that the version of pip you're running is 8.1.1, not that the version of pip you just installed is 8.1.1.)

@njsmith
Copy link
Member

njsmith commented Jun 5, 2016

Also, if I try using python 2.7's pip, like in the linked askubuntu question, I get:

njs@8bde0cc97ff7:~$ pip install --upgrade pip
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |################################| 1.2MB 883kB/s 
Installing collected packages: pip
Successfully installed pip-8.1.2
njs@8bde0cc97ff7:~$ pip install --upgrade pip
Requirement already up-to-date: pip in ./.local/lib/python2.7/site-packages
njs@8bde0cc97ff7:~$ pip --version
pip 8.1.2 from /home/njs/.local/lib/python2.7/site-packages (python 2.7)

So not only does that work, but it also avoids the weird output issues I saw with the xenial pip3.

@dstufft
Copy link
Member

dstufft commented Jun 5, 2016

I think this is going to be because Ubuntu patches their pip to prevent it from modifying packages installed with apt.

@edwinksl
Copy link

edwinksl commented Jun 5, 2016

@njsmith: I get the "You are using pip version 8.1.1, however version 8.1.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command." message for pip for both Python 2 (pip) and Python 3 (pip3). For Python 2, pip --version gives pip 8.1.2 from /home/edwinksl/.local/lib/python2.7/site-packages (python 2.7) and for Python 3, pip3 --version gives pip 8.1.2 from /home/edwinksl/.local/lib/python3.5/site-packages (python 3.5). Therefore, it does seem that pip has been successfully upgraded from 8.1.1 to 8.1.2 for both Pythons despite the (misleading) warning messages.

The issue here is I don't know if the bug with the erroneous warning messages lies with pip itself or with the Ubuntu patches for pip as suggested by @dstufft.

@dstufft
Copy link
Member

dstufft commented Jun 5, 2016

Oh right, it installing into --user, I forgot Ubuntu applied that patch, if you're still getting that error message, it might be because of wonky sys.path. What does python -c "import pip; print(pip.__version__)" give you?

@edwinksl
Copy link

edwinksl commented Jun 5, 2016

@dstufft python -c "import pip; print(pip.__version__)" gives 8.1.2.

@dstufft
Copy link
Member

dstufft commented Jun 5, 2016

Interesting... and you're still getting that "you're using 8.1.1 but 8.1.2 is available" message?

@edwinksl
Copy link

edwinksl commented Jun 5, 2016

@dstufft I only got that message on the first invocation of pip install -U pip for Python 2 and pip3 install -U pip for Python 3. Subsequent invocations gave Requirement already up-to-date: pip in ./.local/lib/python2.7/site-packages for Python 2 and Requirement already up-to-date: pip in ./.local/lib/python3.5/site-packages for Python 3.

@dstufft
Copy link
Member

dstufft commented Jun 5, 2016

Ah- Ok then I think that's just a bug that I think we have open somewhere else, where upgrading sometimes doesn't indicate the newest version until after the processes has completely exited.

@edwinksl
Copy link

edwinksl commented Jun 5, 2016

@dstufft That makes sense to me, thanks!

@jelabarre59
Copy link

Same thing here. python -c "import pip; print(pip.version)" reports "8.1.2", yet I still get the error. Unless it's because the command I need to run (STATIC_DEPS=true sudo -H pip install lxml==3.6.0) is calling it with sudo?

@scotmatson
Copy link

Just contributing to make some additional noise regarding this issue. The upgrade fails for me as well, additionally, uninstalling pip3 and reinstalling results in version 8.1.1, not 8.1.2.

@nikhilgoyal22
Copy link

does sudo -H pip install --upgrade pip work for anyone?

@adrian-jasinski
Copy link

Not working on ubuntu 16.04

sudo -H pip install --upgrade pip
Collecting pip
  Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@adrian-jasinski
Copy link

adrian-jasinski commented Aug 29, 2016

It working:


wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz

tar -xzvf pip-8.1.2.tar.gz

cd pip-8.1.2

sudo python setup.py install

@fuzaro
Copy link

fuzaro commented Sep 13, 2016

admed
thank you

@xavfernandez
Copy link
Member

As the real issue seems to be the old version reported when installing the new version, I'm closing this issue as duplicate of #3049, #2382 and #3709

@Sparrow1029
Copy link

Hi there! I had the same problem on Linux Mint 18, finally found the answer on pip's homepage! This method worked for me. Hope it helps!

@stevenfrancisco
Copy link

You might have multiple Python Versions installed. I'm running Ubuntu 16.04 and finally figured that I needed to upgrade the pip in both python 2.7 and 3. Since I run them side by side, I needed to specify pip3

pip3 install -U pip

@aospan
Copy link

aospan commented Jan 4, 2017

same issue on 'Ubuntu 16.04.1 LTS'. but following commands helps:


apt-get remove python3-pip python-pip
pip2 install -U pip
pip3 install -U pip

now it's ok:

# pip install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
# python2 -c "import pip; print(pip.__version__)"
9.0.1
# python3 -c "import pip; print(pip.__version__)"
9.0.1

@quinncomendant
Copy link

I was getting the same error of Certbot has problem setting up the virtual environment and You are using pip version 8.0.3, however version 9.0.1 is available when running certbot-auto via cron. Running certbot-auto regularly (as root) works fine. To solve this I had to add export HOME=/root to the start of the cron command, like this:

48 */11 * * * export HOME=/root; /root/bin/certbot-auto renew --quiet --no-self-upgrade

@dzumret
Copy link

dzumret commented Mar 5, 2017

I removed first pip3 with:

sudo apt remove python3-pip

Then installed with:
python get-pip.py

Instructions can be found here:
https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

@w-barath
Copy link

w-barath commented Jun 5, 2017

Full process flow to install latest pip: (some steps may be redundant if you already have pip installed but no harm done)

sudo su                               # become root
cd                                    # prevent trashing your user's python cache permissions
apt-get install python3-pip           # bring in easy_install3
pip install --upgrade pip             # cache latest pip sources
apt-get remove python3-pip python-pip # remove Ubuntu's pip
easy_install3 pip                     # install up to date vanilla pip
pip --version                         # verify it
exit                                  # back to your user.

@htdinh
Copy link

htdinh commented Aug 3, 2017

This works for me in Python 2.
sudo apt-get purge --auto-remove python-pip
Then follow steps by @sc00ut above.

@dotw
Copy link

dotw commented Sep 14, 2017

This works for me too. Following the steps of @Dinh-Hung-Tu & @sc00ut
and the latest step is
hash -r
to refresh cache

@LF-DevJourney
Copy link

apt update && upgrade python3-pip

@zkhodzhaev
Copy link

thank you admen, it worked.

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests