2017-06-05 4 views
0

Ich arbeite an einem Python3.4/Django-Projekt (auf CentOS 6.8x64) und versuche, den mysqlclient-Treiber zu installieren. Trotz stundenlangem Googlen kann ich nicht herausfinden, wie man während der Installation einen Kompilierungsfehler sieht.mysqlclient pip failure unter Linux

Soweit ich das beurteilen kann habe ich alle notwendigen Bibliothekspakete installiert aber bisher kein Glück. Hier ist die Ausgabe (sorry für die Ausführlichkeit):

$ sudo pip3 install mysqlclient 
Collecting mysqlclient 
    Using cached mysqlclient-1.3.10.tar.gz 
Installing collected packages: mysqlclient 
    Running setup.py install for mysqlclient ... error 
    Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qqqgbh_2/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cwqrqsw1-record/install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_py 
    creating build 
    creating build/lib.linux-x86_64-3.4 
    copying _mysql_exceptions.py -> build/lib.linux-x86_64-3.4 
    creating build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.4/MySQLdb 
    creating build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.4/MySQLdb/constants 
    running build_ext 
    building '_mysql' extension 
    creating build/temp.linux-x86_64-3.4 
    gcc -pthread -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 -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 -I/usr/include/mysql -I/usr/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o 
    _mysql.c: In function ‘_mysql_ConnectionObject_ping’: 
    _mysql.c:1911: error: ‘MYSQL’ has no member named ‘reconnect’ 
    error: command 'gcc' failed with exit status 1 

    ---------------------------------------- 
Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qqqgbh_2/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cwqrqsw1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qqqgbh_2/mysqlclient/ 
+1

Das scheint mir eine Bibliothekskompatibilität Sache. Ist es möglich, dass ich eine ältere Version von mysqlclient benötige? – Gadzooks34

Antwort

0

ich denke, Sie brauchen mysql-devel oder MariaDB-devel installieren (falls das bereits vorhanden ist auf CentOS 6), um zu kompilieren.

yum install mysql-devel 
+1

Ich dachte, das war es auch, aber ich habe es bereits installiert (MariaDB-devel.x86_64) – Gadzooks34

+0

Ich dachte das gleiche, ich habe das Problem mit MariaDB. Ich habe die folgende Installation von einer MariaDB Perspektive ... $ sudo dnf Liste installiert | grep "maria" Mariadb Mariadb-Gemeinsame Mariadb-Config Mariadb-Entwicklung Mariadb-Errmsg Mariadb-libs Mariadb-Server Mariadb-Server-Utils – mjwittering

+0

Viele von denen, die ich nicht einmal im Repo aufgeführt. Ich dachte, ich habe den Standard von der MariaDB Website hinzugefügt. Musstest du noch einen hinzufügen? – Gadzooks34

0

Stellt sich heraus, es ist ein Kompatibilitätsproblem zwischen mysqlclient und die neueste Version von MariaDB (10.2) war. Ich habe meinen Paket-Repo so angepasst, dass er auf ältere Versionen von MariaDB (10.0 oder 10.1) zeigt und einen dieser mysqlclient installiert und ohne Probleme installiert hat.

Verwandte Themen