error : command 'gcc' failed with exit status 1 während der Installation von pygresql
Ich versuche zu installieren die pygresql-Paket mit "pip install pygresql", aber ich bekomme den Fehler : command 'gcc' failed with exit status 1
Ich habe versucht, eine Menge der Sache, aber ich verstehe immer noch nicht, warum es nicht funktioniert
Collecting pygresql
Using cached PyGreSQL-5.0.3.tar.gz
Building wheels for collected packages: pygresql
Running setup.py bdist_wheel for pygresql ... error
Complete output from command /Users/paulinelanquetin/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-build-s7kjrkvj/pygresql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/tmpvvbd5puepip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying pg.py -> build/lib.macosx-10.7-x86_64-3.6
copying pgdb.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_pg' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/paulinelanquetin/anaconda/include -arch x86_64 -I/Users/paulinelanquetin/anaconda/include -arch x86_64 -DPYGRESQL_VERSION=5.0.3 -DDIRECT_ACCESS -DLARGE_OBJECTS -DDEFAULT_VARS -DESCAPING_FUNCS -I/Users/paulinelanquetin/anaconda/include/python3.6m -I/usr/local/Cellar/postgresql/9.6.2/include -I/Users/paulinelanquetin/anaconda/include/python3.6m -c pgmodule.c -o build/temp.macosx-10.7-x86_64-3.6/pgmodule.o -O2 -funsigned-char -Wall -Werror
pgmodule.c:3694:3: error: code will never be executed [-Werror,-Wunreachable-code]
long num_rows;
^~~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pygresql
Running setup.py clean for pygresql
Failed to build pygresql
Installing collected packages: pygresql
Running setup.py install for pygresql ... error
Complete output from command /Users/paulinelanquetin/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-build-s7kjrkvj/pygresql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-l99qu955-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying pg.py -> build/lib.macosx-10.7-x86_64-3.6
copying pgdb.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_pg' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/paulinelanquetin/anaconda/include -arch x86_64 -I/Users/paulinelanquetin/anaconda/include -arch x86_64 -DPYGRESQL_VERSION=5.0.3 -DDIRECT_ACCESS -DLARGE_OBJECTS -DDEFAULT_VARS -DESCAPING_FUNCS -I/Users/paulinelanquetin/anaconda/include/python3.6m -I/usr/local/Cellar/postgresql/9.6.2/include -I/Users/paulinelanquetin/anaconda/include/python3.6m -c pgmodule.c -o build/temp.macosx-10.7-x86_64-3.6/pgmodule.o -O2 -funsigned-char -Wall -Werror
pgmodule.c:3694:3: error: code will never be executed [-Werror,-Wunreachable-code]
long num_rows;
^~~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/paulinelanquetin/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-build-s7kjrkvj/pygresql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-l99qu955-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/y9/vbfql6394h3g6_4ldhwqzx1c0000gp/T/pip-build-s7kjrkvj/pygresql/
Du musst angemeldet sein, um einen Kommentar abzugeben.
Habe ich zwei Lösungen für dieses problem, die ich finden konnte. Ich lief in genau dieses problem versucht zu installieren, pygresql in einem conda vitrual-Umgebung auf OSX Sierra 10.12.5 und mit dem gcc installiert von xcode-select --install. Meine Lösung für dieses (wenn anderen diese) war dieser Befehl in das terminal:
Dadurch das problem gelöst ist für die Installation in der conda-Umgebung, die Sie verwenden, wie ein work-around. Installieren anaconda oder miniconda dann führen Sie diese Befehle im terminal:
Empfehle ich mit conda oder virtualenv, wenn dabei die Entwicklung in python zu vermeiden, diese Arten von Fragen.
Mehr direkte Lösung zu deinem problem fand ich in dieses ähnliche Problem. Ich war in der Lage zu lösen pip-Installation direkt in das OSX python (nicht die conda env), die durch die Ausführung dieser Befehle in das terminal: