2017-03-07 2 views
0

Wenn psycopg2 auf Amazon Linux Installation diesen Befehl: sudo pip-3.4 install psycopg2 ich diese Ausgabe:Fehler bei dem Installieren psycopg2 auf Amazon Linux

gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7 (dt dec pq3 ext)" -DPG_VERSION_NUM=90218 -I/usr/include/python3.4m -I. -I/usr/include/pgsql92 -I/usr/include/pgsql92/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement 
    In file included from ./psycopg/replication_cursor.h:30:0, 
        from psycopg/psycopgmodule.c:32: 
    ./psycopg/libpq_support.h:31:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XLogRecPtr’ 
    typedef unsigned PG_INT64_TYPE XLogRecPtr; 
            ^
    In file included from psycopg/psycopgmodule.c:32:0: 
    ./psycopg/replication_cursor.h:47:5: error: unknown type name ‘XLogRecPtr’ 
     XLogRecPtr write_lsn;  /* LSNs for replication feedback messages */ 
     ^
    ./psycopg/replication_cursor.h:48:5: error: unknown type name ‘XLogRecPtr’ 
     XLogRecPtr flush_lsn; 
     ^
    ./psycopg/replication_cursor.h:49:5: error: unknown type name ‘XLogRecPtr’ 
     XLogRecPtr apply_lsn; 
     ^
    In file included from psycopg/psycopgmodule.c:33:0: 
    ./psycopg/replication_message.h:46:5: error: unknown type name ‘XLogRecPtr’ 
     XLogRecPtr data_start; 
     ^
    ./psycopg/replication_message.h:47:5: error: unknown type name ‘XLogRecPtr’ 
     XLogRecPtr wal_end; 
     ^
    error: command 'gcc' failed with exit status 1 

Ich habe bereits gcc, postgresql-devel, postgresql-libs und python34-devel installiert. Fehle ich ein Paket oder eine Einstellung?

Edit: Dies ist auf einem EMR-Knoten.

Antwort

1

Ich habe das gleiche Problem mit EMR, habe ich versucht, unter

sudo yum -y install gcc python-setuptools python-devel postgresql-devel 
sudo /usr/bin/pip install --upgrade pip 
sudo /usr/local/bin/pip install psycopg2 

Es funktioniert, wenn ich es auf EMR renne aber funktioniert nicht, wenn EMR von Pipeline spin up ist.

+0

Danke! Die Aktualisierung von pip hat das Problem behoben. Leider verursacht es andere Probleme mit einer Pip-Version, aber das sollte jetzt funktionieren. Ich arbeite auch an EMR, also vielleicht hängt das mit dem Problem zusammen. – jarbaugh

Verwandte Themen