简体   繁体   中英

Python and GCC version

I am trying to build some libraries (like fable, PIL..) on my Mac OS X Lion 10.7.3. When I enter the Python interpreter on the Terminal, I have the version 4.0.1 of gcc:

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 14:13:39) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

But interestingly, if I enter python2.6 , I have gcc 4.2.1:

[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.`

I want to use Python (version 2.7.2 because it's the latest I have), but compiling is impossible in this Python version. With the command python setup.py install , I have the error message:

unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1

Is it normal on a Mac? Can anybody help me to define gcc 4.2.1 for Python 2.7.2 ?

Entering this command export ARCHFLAGS="-arch i686" within sudo su mode solve the problem. Don't ask me why !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM