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

Installing pip for multiple Python versions does not work with symlinks #5533

Closed
MichaelKim0407 opened this issue Jun 26, 2018 · 7 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation state: needs reproducer Need to reproduce issue

Comments

@MichaelKim0407
Copy link

Environment

  • pip version: 10.0.1
  • Python version: 2.7.14 + 3.6.4
  • OS: MacOS High Sierra

Description

At the time of installation, pip, pipX, and pipX.Y will be written to /usr/local/bin. If there are existing symlinks, e.g. pip is symlinked to pipZ.W, this will overwrite pip executables for different versions and obviously break things.

Expected behavior

Remove the symlink and write a new file.

How to Reproduce

  1. Install pip for Python 2.7 (python get-pip.py)
  2. cd /usr/local/bin, rm pip, ln -s pip2.7 pip
  3. Install pip for Python 3.6 (python3 get-pip.py)

Output

pip2.7 is now running 3.6

@pradyunsg
Copy link
Member

FWIW, you shouldn't really be using the MacOS provided Python for development since that might cause your OS to become unstable (if you make changes to packages which break something).

@MichaelKim0407
Copy link
Author

@pradyunsg I'm not using the system Python. In fact, the system python on High Sierra is 2.7.10, not 2.7.14

@pradyunsg
Copy link
Member

Ah. My bad. 😅

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Jul 23, 2018
@chrahunt chrahunt added S: awaiting response Waiting for a response/more information state: needs reproducer Need to reproduce issue labels Aug 10, 2019
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Aug 10, 2019
@chrahunt
Copy link
Member

I can't reproduce this upgrading from 10.0.1 to 19.2.1 in a venv:

repro.sh
docker run -it python sh -c 'touch /usr/local/bin/pip2.7 && ln -sf pip2.7 /usr/local/bin/pip && ls -l /usr/local/bin && curl -o /get-pip.py https://bootstrap.pypa.io/get-pip.py && python /get-pip.py; ls -l /usr/local/bin'
Output
total 112
lrwxrwxrwx 1 root staff     8 Jun 27  2018 2to3 -> 2to3-3.6
-rwxr-xr-x 1 root staff   101 Jun 27  2018 2to3-3.6
-rwxr-xr-x 1 root staff   239 Jun 27  2018 easy_install
-rwxr-xr-x 1 root staff   239 Jun 27  2018 easy_install-3.6
lrwxrwxrwx 1 root staff     5 Jun 27  2018 idle -> idle3
lrwxrwxrwx 1 root staff     7 Jun 27  2018 idle3 -> idle3.6
-rwxr-xr-x 1 root staff    99 Jun 27  2018 idle3.6
lrwxrwxrwx 1 root staff     6 Aug 10 15:58 pip -> pip2.7
-rw-r--r-- 1 root staff     0 Aug 10 15:58 pip2.7
-rwxr-xr-x 1 root staff   221 Jun 27  2018 pip3
-rwxr-xr-x 1 root staff   221 Jun 27  2018 pip3.6
lrwxrwxrwx 1 root staff     6 Jun 27  2018 pydoc -> pydoc3
lrwxrwxrwx 1 root staff     8 Jun 27  2018 pydoc3 -> pydoc3.6
-rwxr-xr-x 1 root staff    84 Jun 27  2018 pydoc3.6
lrwxrwxrwx 1 root staff     7 Jun 27  2018 python -> python3
lrwxrwxrwx 1 root staff    14 Jun 27  2018 python-config -> python3-config
lrwxrwxrwx 1 root staff     9 Jun 27  2018 python3 -> python3.6
lrwxrwxrwx 1 root staff    16 Jun 27  2018 python3-config -> python3.6-config
-rwxr-xr-x 2 root staff 33024 Jun 27  2018 python3.6
lrwxrwxrwx 1 root staff    17 Jun 27  2018 python3.6-config -> python3.6m-config
-rwxr-xr-x 2 root staff 33024 Jun 27  2018 python3.6m
-rwxr-xr-x 1 root staff  3089 Jun 27  2018 python3.6m-config
lrwxrwxrwx 1 root staff    10 Jun 27  2018 pyvenv -> pyvenv-3.6
-rwxr-xr-x 1 root staff   441 Jun 27  2018 pyvenv-3.6
-rwxr-xr-x 1 root staff   218 Jun 27  2018 wheel
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1733k  100 1733k    0     0   9.9M      0 --:--:-- --:--:-- --:--:--  9.9M
Collecting pip
  Downloading https://files.pythonhosted.org/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 6.0MB/s
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-19.2.1
Killed
total 116
lrwxrwxrwx 1 root staff     8 Jun 27  2018 2to3 -> 2to3-3.6
-rwxr-xr-x 1 root staff   101 Jun 27  2018 2to3-3.6
-rwxr-xr-x 1 root staff   239 Jun 27  2018 easy_install
-rwxr-xr-x 1 root staff   239 Jun 27  2018 easy_install-3.6
lrwxrwxrwx 1 root staff     5 Jun 27  2018 idle -> idle3
lrwxrwxrwx 1 root staff     7 Jun 27  2018 idle3 -> idle3.6
-rwxr-xr-x 1 root staff    99 Jun 27  2018 idle3.6
-rwxr-xr-x 1 root staff   220 Aug 10 15:58 pip
-rw-r--r-- 1 root staff     0 Aug 10 15:58 pip2.7
-rwxr-xr-x 1 root staff   220 Aug 10 15:58 pip3
-rwxr-xr-x 1 root staff   220 Aug 10 15:58 pip3.6
lrwxrwxrwx 1 root staff     6 Jun 27  2018 pydoc -> pydoc3
lrwxrwxrwx 1 root staff     8 Jun 27  2018 pydoc3 -> pydoc3.6
-rwxr-xr-x 1 root staff    84 Jun 27  2018 pydoc3.6
lrwxrwxrwx 1 root staff     7 Jun 27  2018 python -> python3
lrwxrwxrwx 1 root staff    14 Jun 27  2018 python-config -> python3-config
lrwxrwxrwx 1 root staff     9 Jun 27  2018 python3 -> python3.6
lrwxrwxrwx 1 root staff    16 Jun 27  2018 python3-config -> python3.6-config
-rwxr-xr-x 2 root staff 33024 Jun 27  2018 python3.6
lrwxrwxrwx 1 root staff    17 Jun 27  2018 python3.6-config -> python3.6m-config
-rwxr-xr-x 2 root staff 33024 Jun 27  2018 python3.6m
-rwxr-xr-x 1 root staff  3089 Jun 27  2018 python3.6m-config
lrwxrwxrwx 1 root staff    10 Jun 27  2018 pyvenv -> pyvenv-3.6
-rwxr-xr-x 1 root staff   441 Jun 27  2018 pyvenv-3.6
-rwxr-xr-x 1 root staff   218 Jun 27  2018 wheel

Can you confirm if you're still able to reproduce this?

@chrahunt
Copy link
Member

chrahunt commented Sep 6, 2019

Hello! It's been some time, so I will close this issue. Please let us know if you're still having any problems. Thanks!

@chrahunt chrahunt closed this as completed Sep 6, 2019
@MichaelKim0407
Copy link
Author

Hi @chrahunt , please see #5534

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Sep 7, 2019
@no-response no-response bot reopened this Sep 7, 2019
@MichaelKim0407
Copy link
Author

Well, I did not mean to reopen this. It should be closed

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 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 state: needs reproducer Need to reproduce issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants