Mac OS X 10.7.5上的致命错误'stdio.h'Python 2.7.3 [英] fatal error 'stdio.h' Python 2.7.3 on Mac OS X 10.7.5

查看:182
本文介绍了Mac OS X 10.7.5上的致命错误'stdio.h'Python 2.7.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我,这个问题更适合于Stack Overflow(而不是ServerFault)

I was told that this question is better suited here at Stack Overflow ( and not ServerFault )

就这样:

我在Mac OS X 10.7.5上有这个奇怪的问题

I have this weird issue on my Mac OS X 10.7.5

/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found

是什么原因导致上述错误? 此错误困扰着我,由于无法执行此步骤,因此我无法安装mysql-python.

What caused the above error? This error has been bugging me and i can't install mysql-python as i'm stuck with this step.

我正在使用Python 2.7.3. Google App Engine(python),python脚本,龙卷风之类的东西通常可以在我的Mac上运行.但不是mysql-python.

I'm using Python 2.7.3. Things like Google App Engine ( python ), python script, tornado generally works on my mac. But not mysql-python.

我已经使用dmg映像安装了MySQL,并将mysql文件夹复制到/usr/local/

I've install MySQL using the dmg image and have copied the mysql folder to /usr/local/

我该如何解决?

我也尝试运行命令:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ 并且比通过运行安装mysql-python sudo python setup.py install.

I've also tried running the command: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ and than installing mysql-python by running sudo python setup.py install.

但是收到以下信息:

running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
gcc-4.2 not found, using clang instead
building '_mysql' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,4,'rc',5) -D__version__=1.2.4c1 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch x86_64
In file included from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
error: command 'clang' failed with exit status 1

我还可以通过哪些其他方式解决它?

What other possible ways can i fix it?

谢谢!

最好的问候.

推荐答案

我想通了.

只需安装Xcode中提供的命令行工具即可解决问题.

Just need to install the command line tools found in Xcode and the problems will be solved.

干杯.

这篇关于Mac OS X 10.7.5上的致命错误'stdio.h'Python 2.7.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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