title: Upgrading `pip` removes other python's pips
body: <p>On a CentOS 7 system, I have multiple versions of Python installed, each with their own version of <code>pip</code>:</p>
  
  <pre><code># head -n1 /usr/local/bin/pip3.*
  ==&gt; /usr/local/bin/pip3.6 &lt;==
  #!/usr/bin/python3
  
  ==&gt; /usr/local/bin/pip3.7 &lt;==
  #!/usr/local/bin/python3.7
  
  ==&gt; /usr/local/bin/pip3.8 &lt;==
  #!/usr/local/bin/python3.8
  </code></pre>
  
  <p>When I ask <code>pip3.8</code> to upgrade itself, it removes the installed <code>pip3.7</code>:</p>
  
  <pre><code># pip3.8 install --upgrade pip
  Collecting pip
    Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
  Installing collected packages: pip
    Found existing installation: pip 19.2.3
      Uninstalling pip-19.2.3:
        Successfully uninstalled pip-19.2.3
  Successfully installed pip-20.0.2
  
  
  # head -n1 /usr/local/bin/pip3.*
  ==&gt; /usr/local/bin/pip3.6 &lt;==
  #!/usr/bin/python3
  
  ==&gt; /usr/local/bin/pip3.8 &lt;==
  #!/usr/local/bin/python3.8
  </code></pre>
  
  <p>Why is it doing this, and how can I prevent it?</p>
  
  <p><strong>UPDATES</strong>:</p>
  
  <ul>
  <li>The lib paths are different for the two installations, as shown here:</li>
  </ul>
  
  <pre><code># python3.7 -c 'import sys; print(sys.path)'
  ['', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages']
  # python3.8 -c 'import sys; print(sys.path)'
  ['', '/usr/local/lib/python38.zip', '/usr/local/lib/python3.8', '/usr/local/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/site-packages']
  </code></pre>
  
  <ul>
  <li><p>It is not bidirectional - upgrading <code>pip3.7</code> does not remove <code>pip3.8</code>.</p></li>
  <li><p>I believe the <em>library</em> gets upgraded correctly and leaves the version 3.7 library in place, it's just the shell wrapper script that's deleted.  Here's after the <code>pip3.8</code> upgrade:</p></li>
  </ul>
  
  <pre><code># python3.7 -m pip --version
  pip 20.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
  # python3.8 -m pip --version
  pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
  # pip3.7 --version
  bash: pip3.7: command not found
  # pip3.8 --version
  pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
  </code></pre>
  
  <ul>
  <li><p>Doing <code>pip3.7 install --upgrade pip</code> does not remove <code>/usr/local/bin/pip3.6</code>, so it's not the case that it always removes previous versions.</p></li>
  <li><p>For full reproducibility, and to show that I'm starting with a fairly pristine system, here's a Gist containing my Dockerfile text: <a href="https://gist.github.com/kenahoo/a1104f9cb84694fbd5ec9d6d560a885e" rel="nofollow noreferrer">https://gist.github.com/kenahoo/a1104f9cb84694fbd5ec9d6d560a885e</a> .  It fails on the <code>RUN pip3.7 install setuptools numpy pandas</code> line because <code>pip3.7</code> has gone missing.</p></li>
  <li><p>It doesn't matter whether I upgrade using <code>python3.8 -m pip install --upgrade pip</code> or <code>pip3.8 install --upgrade pip</code>, both of them end up removing the <code>/usr/local/bin/pip3.7</code> wrapper script.</p></li>
  </ul>