Error compiling Cython on Mac 10.6
-
27-10-2019 - |
Question
Trying to install Cython so I can use openKinect Python wrapper.
I downloaded Xcode from the appstore (no install options. lame).
Im getting the following compile errors when trying to install
I also tried easy_install and that failed as well.
Error Code below
creating build/temp.macosx-10.6-universal-2.6/Cython/Plex
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -
Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -
I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c
./Cython/Plex/Scanners.c -o build/temp.macosx-10.6-universal-
2.6/./Cython/Plex/Scanners.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler
(/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as)
for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
./Cython/Plex/Scanners.c:6694: fatal error: error writing to -: Broken pipe
Solution
Before your command (but after any sudo
) put
env ARCHFLAGS="-arch i386 -arch x86_64"
(When installing, you may want to omit the arch you don't have)
I do not have a Mac, I'm just putting through advice from python easy_install fails with "assembler for architecture ppc not installed" on Mac OS X
OTHER TIPS
I had the same issue (with Cython installation and other modules). Using krzysz00's advice, here are the exact steps (Mac OS X 10.6.8) :
$ uname -a
Darwin machine_name 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
$ cd Cython-0.14.1
$ sudo su -
# export ARCHFLAGS="-arch i386 -arch x86_64"
# python ./setup.py install
# exit
$
$ which cython
/usr/local/bin/cython
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow