-->

appscript on OSX 10.6.3 / Python 2.6.1

2019-07-18 20:48发布

问题:

I am having some trouble getting appscript installed on OS/X 10.6.3 / Python 2.6.1. When I issue

sudo easy_install appscript

I get "unable to execute gcc-4.2: No such file or directory". Even when I do export CC=/Developer/usr/bin/gcc-4.2 (a valid gcc-4.2 executable), easy_install barks.

What could be the issue?

Disclaimer: OS/X newbie at the helm...

回答1:

Rerun the Xcode installer and check "UNIX Development" - it will put compilers in /usr/bin in addition to /Developer.



回答2:

I don't think the solution proposed is sufficient in many cases, as (for example) I already have the tools in /usr/bin and get the same error.

The problem is that gcc is being invoked with an -arch ppc flag, which generally is not supported any longer.

You need to (a) set ARCHFLAGS in the shell environment so that is it something like '-arch i386 -arch x86_64' or for (b) for a permanent fix:

edit /System/Library/Frameworks/Python.framework/Versions/Current/lib/python*/distutils/sysconfig.py

to change archflags = '-arch i386 -arch ppc -arch x86_64' or be archflags = '-arch i386 -arch x86_64'