GCC-4.2-Fehler unter Mac OS-X Mountain Lion, einige Pakete mit pip / virtualenv können nicht installiert werden
Ich sehe einen sehr nervigen Bug, mit dem ich nicht wirklich umgehen kann. Es scheint ziemlich verbreitet zu sein, und ich habe fast jede Lösung ausprobiert, die ich vergeblich finden konnte.
Ich versuche Bibliotheken mit Pip zu installieren. Dieses Problem trat bei gevent, psycopg2 und greenlet auf. Das Problem scheint zu sein, dass mein Computer keinen bestimmten C-Compiler finden kann, der mit XCode 4: gcc-4.2 aufwarten sollte. Hier ist ein Beispiel (obwohl Versuche auch in einer virtuellen Umgebung unternommen wurden).
Last login: Sun Jul 29 23:35:54 on ttys000
*******s-MacBook-Pro:~ ******$ pip install gevent
Downloading/unpacking gevent
Downloading gevent-0.13.7.tar.gz (288Kb): 288Kb downloaded
Running setup.py egg_info for package gevent
Downloading/unpacking greenlet (from gevent)
Downloading greenlet-0.4.0.zip (72Kb): 72Kb downloaded
Running setup.py egg_info for package greenlet
Installing collected packages: gevent, greenlet
Running setup.py install for gevent
building 'gevent.core' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/core.c -o build/temp.macosx-10.6-intel-2.7/gevent/core.o
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
from gevent/core.c:4:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from gevent/core.c:225:
gevent/libevent.h:9:19: error: event.h: No such file or directory
gevent/libevent.h:38:20: error: evhttp.h: No such file or directory
gevent/libevent.h:39:19: error: evdns.h: No such file or directory
gevent/core.c:361: error: field ‘ev’ has incomplete type
gevent/core.c:741: warning: parameter names (without types) in function declaration
....more like this but i'll skip it for now....
copying gevent/wsgi.py -> build/lib.macosx-10.6-intel-2.7/gevent
running build_ext
building 'gevent.core' extension
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/gevent
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/core.c -o build/temp.macosx-10.6-intel-2.7/gevent/core.o
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
from gevent/core.c:4:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from gevent/core.c:225:
gevent/libevent.h:9:19: error: event.h: No such file or directory
gevent/libevent.h:38:20: error: evhttp.h: No such file or directory
gevent/libevent.h:39:19: error: evdns.h: No such file or directory
....more like this as well....
gevent/core.c:15559: warning: assignment makes pointer from integer without a cast
gevent/core.c: At top level:
gevent/core.c:21272: error: expected ‘)’ before ‘val’
lipo: can't figure out the architecture type of: /var/folders/xc/f2mg5kn96kqdr3tj19pgyhs00000gn/T//cckLxkJ2.out
error: command 'gcc-4.2' failed with exit status 1
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/Users/******/build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/xc/f2mg5kn96kqdr3tj19pgyhs00000gn/T/pip-yA5oWR-record/install-record.txt failed with error code 1 in /Users/******/build/gevent
Storing complete log in /Users/******/.pip/pip.log
***********s-MacBook-Pro:~ ******$
Dinge, die Sie fragen könnten:
1) Haben Sie versucht, ein virtuelles env zu verwenden?
Ja. Und ich habe versucht, einen bereits existierenden gcc (der im Verzeichnis / usr / bin / vorhanden ist) wie folgt zu verknüpfen:
ln -s /usr/bin/gcc gcc-4.2
ln -s /usr/bin/gcc-4.2 gcc-4.2
ln -s /usr/bin/gcc gcc
Nichts davon hat funktioniert.
2) Haben Sie versucht, XCode neu zu installieren?
Ja.
3) Haben Sie die XCode Command Line Tools installiert?
Ja.
4) Bist du sicher, dass du gcc hast?
**********s-MacBook-Pro:~ sanjay$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
5) Python-Installation?
************s-MacBook-Pro:~ ******$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Irgendwelche Ideen, was falsch sein könnte und wie man es behebt?
Ich habe auch versucht, dies zu installieren:https://github.com/kennethreitz/osx-gcc-installer . Ich habe keine Ahnung, was ich sonst noch versuchen soll. Ich bin ein bisschen wie ein neues Kind im Block, wenn es um diese Unix-Codierungs- / Installationssachen geht. Wenn es also etwas gibt, das ich sehr schlecht mache, dann weise bitte darauf hin.
Vielen Dank!