2016-04-01 5 views
0

Ich versuche, python-chess (Python 2.7 unter Windows 7) zu installieren.Fehler bei der Installation von Python-Schach: "UnboundLocalError: lokale Variable 'distclass' referenziert vor Zuweisung"

bekomme ich folgende Fehlermeldung:

C:\Users\Jeroen>pip install python-chess 
Collecting python-chess 
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may caus 
e the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. 
    SNIMissingWarning 
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL con 
nections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 
    Using cached python-chess-0.13.2.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "c:\users\jeroen\appdata\local\temp\pip-build-2eph1o\python-chess\setup.py", line 91, in <module> 
     "Topic :: Software Development :: Libraries :: Python Modules", 
     File "c:\python27\lib\distutils\core.py", line 98, in setup 
     klass = distclass 
    UnboundLocalError: local variable 'distclass' referenced before assignment 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in c:\users\jeroen\appdata\local\temp\pip-build-2eph1o\python-chess\ 

Als ich erneut ausführen pip install python-chess einmal mehr, die SNIMissingWarning nicht mehr angezeigt wird, aber die UnboundLocalError ist immer noch da.

bearbeiten

Antworten auf die Fragen in den Kommentaren:

Python 2.7.3 |EPD_free 7.3-2 (32-bit)| (default, Apr 12 2012, 14:30:37) [MSC v.1500 32 bit (Intel)] on win32 
Type "credits", "demo" or "enthought" for more information. 
>>> import distutils 
>>> print distutils.__version__ 
2.7.3 
>>> 

und C:\Python27\Lib\distutils\core.py um die Linie 90 sieht wie folgt aus:

global _setup_stop_after, _setup_distribution 

# Determine the distribution class -- either caller-supplied or 
# our Distribution (see below). 
klass = distclass 
if klass: 
    del distclass 
else: 
    klass = Distribution 

if 'script_name' not in attrs: 
    script_name = os.path.basename(sys.argv[0]) 
if 'script_args' not in attrs: 
    script_args = sys.argv[1:] 
+0

Welche Ausgabe erhalten Sie für 'python -c 'import distutils; Print distutils .__ Version __'' und 'pip --version'? – snakecharmerb

+0

Das ist ein Fehler in * Python-Core *, wenn das. Welche Version von Python 2.7 ist das? Die Zeilen für "core.py" passen zu keiner Version von 2.7, die ich finden kann, und ich habe von Alpha 1 bis 2.7.11 gecheckt. –

+0

Diese Zeile * sollte * klass = attrs.get ('distclass') 'für alle 2.7-Versionen lesen (obwohl sich die genaue Zeilennummer ein bisschen verschiebt), es sieht also so aus, als ob Ihre Python-Installation beschädigt oder verändert ist. –

Antwort

0

Als Martijn Pieters richtig in den Kommentaren abgeleitet , meine Python-Installation wurde irgendwie beschädigt. Ich habe die neueste Version von Python (2.7.11) installiert und nun funktioniert alles einwandfrei.

Verwandte Themen