Python Cant Run or Reinstall Pip
Question: I have a machine that has Python 2.7 and Python 3.4 installed. Normally to
install packages under Python 3.4, I would run `pip3 install [PACKAGE]`.

But now when I run `pip3` I get

    
    
    Traceback (most recent call last):
      File "/volume1/@appstore/python3/bin/pip3", line 7, in <module>
        from pip import main
      File "/usr/local/python3/lib/python3.4/site-packages/pip/__init__.py", line 16, in <module>
        from pip.vcs import git, mercurial, subversion, bazaar  # noqa
      File "/usr/local/python3/lib/python3.4/site-packages/pip/vcs/subversion.py", line 9, in <module>
        from pip.index import Link
      File "/usr/local/python3/lib/python3.4/site-packages/pip/index.py", line 30, in <module>
        from pip.wheel import Wheel, wheel_ext
      File "/usr/local/python3/lib/python3.4/site-packages/pip/wheel.py", line 32, in <module>
        from pip import pep425tags
      File "/usr/local/python3/lib/python3.4/site-packages/pip/pep425tags.py", line 335, in <module>
        supported_tags = get_supported()
      File "/usr/local/python3/lib/python3.4/site-packages/pip/pep425tags.py", line 307, in get_supported
        elif is_manylinux1_compatible():
      File "/usr/local/python3/lib/python3.4/site-packages/pip/pep425tags.py", line 163, in is_manylinux1_compatible
        return have_compatible_glibc(2, 5)
      File "/usr/local/python3/lib/python3.4/site-packages/pip/pep425tags.py", line 187, in have_compatible_glibc
        version = [int(piece) for piece in version_str.split(".")]
      File "/usr/local/python3/lib/python3.4/site-packages/pip/pep425tags.py", line 187, in <listcomp>
        version = [int(piece) for piece in version_str.split(".")]
    ValueError: invalid literal for int() with base 10: '20-2014'
    

Even if I download `get-pip.py` and run `python3 get-pip.py`, I get the same
error.

What could the problem be?

Edit: Apparently this is a problem that is persistent on Synology installs
when you installed DSM 6.0.


Answer: Found solution courtesy of @Tadhg in the comments above.

[**Here**](https://reviewable.io/reviews/pypa/pip/3590) is a link to the
necessary changes to `pep425tags.py`.

But here are the changes needed for all of you who are on this SO page.

Add the following function:

    
    
    # Separated out from have_compatible_glibc for easier unit testing
    def check_glibc_version(version_str, needed_major, needed_minor):
        # Parse string and check against requested version.
        #
        # We use a regexp instead of str.split because we want to discard any
        # random junk that might come after the minor version -- this might happen
        # in patched/forked versions of glibc (e.g. Linaro's version of glibc
        # uses version strings like "2.20-2014.11"). See gh-3588.
        m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
        if not m:
            warnings.warn("Expected glibc version with 2 components major.minor,"
                          " got: %s" % version_str, RuntimeWarning)
            return False
        return (int(m.group("major")) == needed_major and
                int(m.group("minor")) >= needed_minor)
    

and replace

    
    
    # Parse string and check against requested version.
    version = [int(piece) for piece in version_str.split(".")]
    if len(version) < 2:
        warnings.warn("Expected glibc version with 2 components major.minor,"
                      " got: %s" % version_str, RuntimeWarning)
        return False
    return version[0] == major and version[1] >= minimum_minor
    

with `return check_glibc_version(version_str, major, minimum_minor)`

