我是一个非常业余的程序员; 我已经完成了一些娱乐算法编程,但老实说我不知道库和编程语言是如何组合在一起的.我应该在一个需要一些图像处理的项目上工作,所以我一直试图安装PIL一段时间,但我还是没能.
我去了http://www.pythonware.com/products/pil/并下载了"Python Imaging Library 1.1.6 Source Kit(所有平台)(440k TAR GZ)(2006年12月3日)".然后我在命令提示符下打开文件夹并运行
$ python setup.py build_ext -i .
Run Code Online (Sandbox Code Playgroud)
这是我得到的输出:
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -DHAVE_LIBZ -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _imaging.c -o build/temp.macosx-10.5-i386-2.5/_imaging.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
"import Image"在我尝试时出错了.
你们知道发生了什么事吗?我正在使用配备Core 2 Duo的MacBook Pro.
如果这是非常愚蠢的话,我真的很抱歉.
GCC 是 GNU 编译器。这是一个非常有用的东西。您只需以任何 Mac 友好的方式安装它即可。
http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/