This repository has been archived by the owner. It is now read-only.

Pip3 from Python3 upgrade will break Pip from Python #25752

Closed
cclauss opened this Issue Jan 9, 2014 · 9 comments

Comments

6 participants
@cclauss
Contributor

cclauss commented Jan 9, 2014

Under the current installs, if you do:
pip install --upgrade pip
Followed by:
pip3 install --upgrade pip
Then you do:
pip -V
You will see that both pip and pip3 point to the Python3 pip and the only way to use the Python 2 pip is to use pip2 instead of pip. Reversing the order of the install --upgrade pip commands will deliver the desired result.

Python 3.4 (expected GA date 16 March) should reduce these woes because it will embed pip in the Python3 distribution.

@matthewrankin

This comment has been minimized.

Show comment
Hide comment
@matthewrankin

matthewrankin Jan 28, 2014

@cclauss Even when I reverse the order of the install --upgrade pip commands, pip still points to the Python3 pip.

I tried the following, but it didn't solve the problem:

pip3 install --force-reinstall --upgrade pip
pip install --force-reinstall --upgrade pip

To solve the problem, I had to run:

pip3 install --upgrade pip
pip2 install --upgrade pip

That left me with pip pointing to the Python2 site-packages.

$ pip3 -V
pip 1.5.2 from /usr/local/lib/python3.3/site-packages (python 3.3)
$ pip2 -V
pip 1.5.2 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)
$ pip -V
pip 1.5.2 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

@cclauss Even when I reverse the order of the install --upgrade pip commands, pip still points to the Python3 pip.

I tried the following, but it didn't solve the problem:

pip3 install --force-reinstall --upgrade pip
pip install --force-reinstall --upgrade pip

To solve the problem, I had to run:

pip3 install --upgrade pip
pip2 install --upgrade pip

That left me with pip pointing to the Python2 site-packages.

$ pip3 -V
pip 1.5.2 from /usr/local/lib/python3.3/site-packages (python 3.3)
$ pip2 -V
pip 1.5.2 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)
$ pip -V
pip 1.5.2 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

@cclauss cclauss closed this Feb 14, 2014

@cclauss cclauss reopened this Feb 14, 2014

@adamv

This comment has been minimized.

Show comment
Hide comment
@adamv

adamv Feb 22, 2014

Contributor

Possibly fixed by ddad99c

Contributor

adamv commented Feb 22, 2014

Possibly fixed by ddad99c

@adamv adamv closed this Feb 22, 2014

@joergrathlev

This comment has been minimized.

Show comment
Hide comment
@joergrathlev

joergrathlev May 24, 2015

Contributor

This is not fixed (or maybe it used to be fixed and it's a regression).

Steps to reproduce:

My first attempt to repair this broke something, so I first completely removed my existing Python installations (this should hopefully be obvious, but don't run these commands unless you know what to re-install later):

$ brew uninstall python
$ brew uninstall python3
$ rm -rf /usr/local/lib/python2.7/site-packages
$ rm -rf /usr/local/lib/python3.4/site-packages

Then I re-installed both versions of Python, starting with Python 2.7:

$ brew install python
$ pip install --upgrade pip setuptools
$ brew install python3
$ pip3 install --upgrade pip setuptools

Now both pip and pip3 were linked to the Python 3 version:

~$ pip --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)
~$ pip3 --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)

I could restore the pip command to Python 2.7 by forcing a reinstall via the pip2 command, as suggested by @matthewrankin (thanks!):

~$ pip2 install --upgrade --force-reinstall pip
~$ pip --version
pip 7.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
~$ pip3 --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)
Contributor

joergrathlev commented May 24, 2015

This is not fixed (or maybe it used to be fixed and it's a regression).

Steps to reproduce:

My first attempt to repair this broke something, so I first completely removed my existing Python installations (this should hopefully be obvious, but don't run these commands unless you know what to re-install later):

$ brew uninstall python
$ brew uninstall python3
$ rm -rf /usr/local/lib/python2.7/site-packages
$ rm -rf /usr/local/lib/python3.4/site-packages

Then I re-installed both versions of Python, starting with Python 2.7:

$ brew install python
$ pip install --upgrade pip setuptools
$ brew install python3
$ pip3 install --upgrade pip setuptools

Now both pip and pip3 were linked to the Python 3 version:

~$ pip --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)
~$ pip3 --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)

I could restore the pip command to Python 2.7 by forcing a reinstall via the pip2 command, as suggested by @matthewrankin (thanks!):

~$ pip2 install --upgrade --force-reinstall pip
~$ pip --version
pip 7.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
~$ pip3 --version
pip 7.0.1 from /usr/local/lib/python3.4/site-packages (python 3.4)
@yangj1e

This comment has been minimized.

Show comment
Hide comment
@yangj1e

yangj1e Jun 28, 2015

Contributor

This is not fixed.
+1

Contributor

yangj1e commented Jun 28, 2015

This is not fixed.
+1

@DomT4

This comment has been minimized.

Show comment
Hide comment
@DomT4

DomT4 Jun 28, 2015

Member

This remains a known issue, yes. @tdsmith has commented on it before in several newer issues, but the gist I believe is that we can't do anything about it very practically sadly.

Member

DomT4 commented Jun 28, 2015

This remains a known issue, yes. @tdsmith has commented on it before in several newer issues, but the gist I believe is that we can't do anything about it very practically sadly.

@cclauss

This comment has been minimized.

Show comment
Hide comment
@cclauss

cclauss Jun 28, 2015

Contributor

Python3.rb could run pip -V which would show if 1) pip is installed and 2) if pip pointed to a Python2 library. If both of those conditions are True then the .rb should not install over pip but should only install a pip3.

Contributor

cclauss commented Jun 28, 2015

Python3.rb could run pip -V which would show if 1) pip is installed and 2) if pip pointed to a Python2 library. If both of those conditions are True then the .rb should not install over pip but should only install a pip3.

@DomT4

This comment has been minimized.

Show comment
Hide comment
@DomT4

DomT4 Jun 28, 2015

Member

This isn't a Homebrew formula issue per se.

The Python3 formula does not override pip in HOMEBREW_PREFIX/bin. The part that overrides pip is when a user manually runs a pip3 install --upgrade pip and that logic is handled by pip itself rather than Homebrew or the Python3 formula.

Member

DomT4 commented Jun 28, 2015

This isn't a Homebrew formula issue per se.

The Python3 formula does not override pip in HOMEBREW_PREFIX/bin. The part that overrides pip is when a user manually runs a pip3 install --upgrade pip and that logic is handled by pip itself rather than Homebrew or the Python3 formula.

@cclauss

This comment has been minimized.

Show comment
Hide comment
@cclauss

cclauss Jun 28, 2015

Contributor

Ahh.... Thanks for the explication. I get it now.

Contributor

cclauss commented Jun 28, 2015

Ahh.... Thanks for the explication. I get it now.

@joergrathlev

This comment has been minimized.

Show comment
Hide comment
@joergrathlev

joergrathlev Jun 28, 2015

Contributor

Thanks @DomT4 for the explanation. I agree that it's not a Homebrew issue, then.

Contributor

joergrathlev commented Jun 28, 2015

Thanks @DomT4 for the explanation. I agree that it's not a Homebrew issue, then.

@arowla arowla referenced this issue Sep 24, 2015

Merged

Basic application form #1

4 of 10 tasks complete

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.