2016-05-10 4 views
2

Ich habe eine Maschine, Python 2.7 und Python 3.4 installiert hat. Normalerweise würde ich zur Installation von Paketen unter Python 3.4 pip3 install [PACKAGE] ausführen.Python Cant Run oder Neuinstallation Pip

Aber jetzt, wenn ich pip3 laufen bekomme ich

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' 

Auch wenn ich get-pip.py herunterladen und ausführen python3 get-pip.py, ich den gleichen Fehler.

Was könnte das Problem sein?

Edit: Offenbar ist dies ein Problem, das auf Synology-Installationen persistent ist, wenn Sie DSM 6.0 installierten.

+0

ich denke, es bedeutet, dass die relativ neue 'pep425tags.py' fehlerhaft ist ... –

+0

Was Version von Pip benutzen Sie? –

+0

Was passiert, wenn Sie versuchen, 'pip --python = python3 install -U pip' zu installieren? –

Antwort

0

Gefunden Lösung mit freundlicher Genehmigung von @Tadhg in den Kommentaren oben.

Here ist ein Link zu den notwendigen Änderungen an pep425tags.py.

Aber hier sind die Änderungen für alle von Ihnen, die auf dieser SO-Seite sind.

Fügen Sie die folgende Funktion:

# 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) 

und ersetzen

# 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 

mit return check_glibc_version(version_str, major, minimum_minor)