This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python.org macOS pkg installs pip3 as pip
Type: Stage: resolved
Components: macOS Versions: Python 3.6
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Marcus.Smith, dbxgil, dstufft, ncoghlan, ned.deily, paul.moore, ronaldoussoren
Priority: normal Keywords:

Created on 2018-04-16 23:09 by dbxgil, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6683 merged ned.deily, 2018-05-02 05:28
PR 6684 merged miss-islington, 2018-05-02 05:31
PR 6685 merged miss-islington, 2018-05-02 05:38
Messages (7)
msg315369 - (view) Author: Gilbert Wilson (dbxgil) Date: 2018-04-16 23:09
The python-3.6.5-macosx10.6.pkg installs pip3 as pip. This means if you have both python2.7.x and 3.6.x you get unexpected and undesirable behavior. According to the release notes in 3.6.5:

Python 3 and Python 2 Co-existence

Python.org Python 3.6 and 2.7.x versions can both be installed on your system and will not conflict. Command names for Python 3 contain a 3 in them, python3 (or python3.6), idle3 (or idle3.6), pip3 (or pip3.6), etc.  Python 2.7 command names contain a 2 or no digit: python2 (or python2.7 or python), idle2 (or idle2.7 or idle), etc.

The release notes for Python2.7.14 have a similarly worded note on Python 3 and Python 2 co-existence.

For both Pythons to properly coexist you must install Python2.7.x after installing Python3.6.x or manually fix the changes that the Python installers make to your ~/.profile PATH environmental variable.

$ which pip3
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3

$ ls -l $(dirname $(which pip3))
[SNIP]
-rwxr-xr-x  1 gilw  admin    263 Apr 16 13:05 pip
-rwxr-xr-x  1 gilw  admin    263 Apr 16 13:05 pip3
-rwxr-xr-x  1 gilw  admin    263 Apr 16 13:05 pip3.6
[SNIP]
msg315371 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-16 23:31
Actually, this appears to be a pip upgrade issue.  If you install 3.6.5 from the python.org installers, there is no pip link there, only pip3:

$ cd /Library/Frameworks/Python.framework/Versions/3.6/bin
$ ls -l
total 272
lrwxr-xr-x  1 root  admin      8 Apr 16 19:19 2to3 -> 2to3-3.6
-rwxrwxr-x  1 root  admin    140 Mar 28 06:05 2to3-3.6
-rwxrwxr-x  1 root  admin    281 Apr 16 19:19 easy_install-3.6
lrwxr-xr-x  1 root  admin      7 Apr 16 19:19 idle3 -> idle3.6
-rwxrwxr-x  1 root  admin    138 Mar 28 06:05 idle3.6
-rwxrwxr-x  1 root  admin    253 Apr 16 19:19 pip3
-rwxrwxr-x  1 root  admin    253 Apr 16 19:19 pip3.6
lrwxr-xr-x  1 root  admin      8 Apr 16 19:19 pydoc3 -> pydoc3.6
-rwxrwxr-x  1 root  admin    123 Mar 28 06:05 pydoc3.6
lrwxr-xr-x  1 root  admin      9 Apr 16 19:19 python3 -> python3.6
lrwxr-xr-x  1 root  admin     12 Apr 16 19:19 python3-32 -> python3.6-32
lrwxr-xr-x  1 root  admin     16 Apr 16 19:19 python3-config -> python3.6-config
-rwxrwxr-x  2 root  admin  25920 Mar 28 06:05 python3.6
-rwxrwxr-x  1 root  admin  13568 Mar 28 06:05 python3.6-32
lrwxr-xr-x  1 root  admin     17 Apr 16 19:19 python3.6-config -> python3.6m-config
-rwxrwxr-x  2 root  admin  25920 Mar 28 06:05 python3.6m
-rwxrwxr-x  1 root  admin   2081 Mar 28 06:05 python3.6m-config
lrwxr-xr-x  1 root  admin     10 Apr 16 19:19 pyvenv -> pyvenv-3.6
-rwxrwxr-x  1 root  admin    480 Mar 28 06:05 pyvenv-3.6

But if you then upgrade to pip 10.0.0, which I'm guessing you did, you'll see:

$ ls -l
[...]
-rwxrwxr-x  1 root      admin    138 Mar 28 06:05 idle3.6
-rwxr-xr-x  1 sysadmin  admin    224 Apr 16 19:22 pip
-rwxr-xr-x  1 sysadmin  admin    224 Apr 16 19:22 pip3
-rwxr-xr-x  1 sysadmin  admin    224 Apr 16 19:22 pip3.6
lrwxr-xr-x  1 root      admin      8 Apr 16 19:19 pydoc3 -> pydoc3.6
[...]

So it appears the pip upgrade unconditionally installs both a pip and a pip3 link.  It really shouldn't.

You should check the pip issue tracker and, if not already reported, open a new issue there:  https://github.com/pypa/pip/issues/

Thanks for the report!
msg315372 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-16 23:42
P.S. Of course, you'll probably need to manually remove that spurious pip command.
msg315406 - (view) Author: Gilbert Wilson (dbxgil) Date: 2018-04-17 16:28
Well what do you know, it does indeed look like a pip3 upgrade issue! I'll wander over to the pip issue tracker and file a bug/upvote over there. Thanks!


gilw-mbp:bin gilw$ ls -al pip*
-rwxrwxr-x  1 root  admin  253 Apr 17 09:21 pip3
-rwxrwxr-x  1 root  admin  253 Apr 17 09:21 pip3.6

gilw-mbp:bin gilw$ pip3 install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 1.0MB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-10.0.0
gilw-mbp:bin gilw$ ls -al pip*
-rwxr-xr-x  1 gilw  admin  263 Apr 17 09:23 pip
-rwxr-xr-x  1 gilw  admin  263 Apr 17 09:23 pip3
-rwxr-xr-x  1 gilw  admin  263 Apr 17 09:23 pip3.6
msg316041 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-05-02 05:30
New changeset 0dd80709b5dc03756e7f4510761ae60236bb9f6d by Ned Deily in branch 'master':
bpo-33290: Have macOS installer remove "pip" alias (GH-6683)
https://github.com/python/cpython/commit/0dd80709b5dc03756e7f4510761ae60236bb9f6d
msg316042 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-05-02 05:44
New changeset 1470e43076559d22518f2e8d704fa9426d2659dd by Ned Deily (Miss Islington (bot)) in branch '3.7':
bpo-33290: Have macOS installer remove "pip" alias (GH-6683) (GH-6684)
https://github.com/python/cpython/commit/1470e43076559d22518f2e8d704fa9426d2659dd
msg316043 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-05-02 05:48
New changeset 8ac441876418a217c31fe429733d7fa4704f0e3c by Ned Deily (Miss Islington (bot)) in branch '3.6':
bpo-33290: Have macOS installer remove "pip" alias (GH-6683) (GH-6685)
https://github.com/python/cpython/commit/8ac441876418a217c31fe429733d7fa4704f0e3c
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77471
2018-05-02 05:48:13ned.deilysetmessages: + msg316043
2018-05-02 05:44:01ned.deilysetmessages: + msg316042
2018-05-02 05:38:41miss-islingtonsetpull_requests: + pull_request6381
2018-05-02 05:31:01miss-islingtonsetpull_requests: + pull_request6380
2018-05-02 05:30:39ned.deilysetmessages: + msg316041
2018-05-02 05:28:54ned.deilysetpull_requests: + pull_request6379
2018-04-17 16:28:23dbxgilsetmessages: + msg315406
2018-04-16 23:42:32ned.deilysetmessages: + msg315372
2018-04-16 23:31:25ned.deilysetstatus: open -> closed

nosy: + paul.moore, ncoghlan, dstufft, Marcus.Smith
messages: + msg315371

resolution: third party
stage: resolved
2018-04-16 23:09:40dbxgilcreate