Mac OSX:由于gcc问题,python软件包无法构建 [英] Mac OSX : python packages failed to build because of gcc issues

查看:159
本文介绍了Mac OSX:由于gcc问题,python软件包无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装MySQL-python软件包,但出现以下错误:

I am trying to install MySQL-python package with the following error:

cc1: error: unrecognized command line option "-arch"
cc1: error: unrecognized command line option "-Wno-long-double"
error: Setup script exited with error: command 'gcc' failed with exit status 1

我将Mac OSX version 10.6.8与gcc一起使用

bash-3.2$ gcc --version
gcc (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)  

如何解决此问题?

谢谢

推荐答案

我恢复了Mac随附的gcc,并删除了第一个错误

I restored the gcc that comes with Mac and that removed the first error which is

cc1: error: unrecognized command line option "-arch"  

对于第二个,我从/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
中删除了该选项 从BASECFLAGS并将以下内容添加到我的〜/.bashrc

for the second one, I removed the option from /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile
from BASECFLAGS and added the following to my ~/.bashrc

export C_INCLUDE_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/include
export LIBRARY_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/lib  

这消除了错误

cc1: error: unrecognized command line option "-Wno-long-double"

这篇关于Mac OSX:由于gcc问题,python软件包无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆