PIL安装失败:stdarg.h

时间:2012-01-12 08:54:32

标签: python linux python-imaging-library easy-install

  

可能重复:
  Installing Python Imaging Library (PIL) on Snow Leopard with updated Python 2.6.2

运行MAC 10.7.2尝试安装PIL时,在解决了许多gcc问题后,安装将退出此行:

  

/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25:错误:   stdarg.h:没有这样的文件或目录

我正在使用此行进行安装:

env ARCHFLAGS="-arch i386 -arch x86_64" easy_install PIL

完整输出:

  

警告:''不是有效的包名;请仅使用。分开   setup.py中的包名称   ---使用/ System / Library / Frameworks中的框架包含来自的文件   /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,                    来自/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,                    来自_imaging.c:75:/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25:错误:   stdarg.h:没有这样的文件或目录   _imaging.c:3017:警告:从不兼容的指针类型初始化   _imaging.c:3077:警告:从不兼容的指针类型初始化在包含的文件中   /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,                    来自/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,                    来自_imaging.c:75:/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25:错误:   stdarg.h:没有这样的文件或目录   _imaging.c:3017:警告:从不兼容的指针类型初始化   _imaging.c:3077:警告:从不兼容的指针类型lipo初始化:无法弄清楚架构类型:   /var/folders/2l/nrkm12097b58kk8n9hrbtz840000gn/T//cckCPEox.out错误:   安装脚本退出并显示错误:命令'gcc-4.2'因退出而失败   状态1

1 个答案:

答案 0 :(得分:6)

问题解决了,我采取的步骤:

第1步:已卸载并已安装Xcode,建议在此处: http://binarylionstudios.com/blog/2011/01/30/error-stdarg.h-no-such-file-or-directory/

删除Xcode正确遵循以下答案: How to fully remove Xcode 4

  

sudo / Developer / Library / uninstall-devtools --mode = all

重启mac后使用安装Xcode.app

步骤2:重新安装xcode后,安装失败

  

无法执行gcc-4.2:没有这样的文件或目录PIL

解决我跟着这篇文章: http://aravir-rose.blogspot.com/2011/12/installing-python-27s-imaging-library.html

祝你好运!