Mac osx Django PIL 错误 / usr/bin/cc 文件错误重新安装时

1 投票
1 回答
677 浏览
提问于 2025-04-16 22:40

我在用Django表单上传图片时,遇到了一个非常常见的错误:_imaging C模块没有安装。我试着按照网上很多重新安装的教程去操作,但每次用pip install或者brew install安装PIL时,都会出现一个“找不到目录”的错误,提示在/usr/bin/cc。

有没有人遇到过这个问题?有没有什么建议可以让我朝正确的方向前进?我现在是在一个虚拟环境中运行所有东西,希望继续这样做。

谢谢大家!!

编辑:

安装Xcode解决了我的问题,但现在我又遇到了以下错误:

WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1

1 个回答

2

确定你完全安装了开发者工具吗?在Mac OS X 10.7 Lion上,当你从Mac应用商店下载Xcode 4.1时,它会把一个安装程序下载到/Applications文件夹里。你需要手动运行这个安装程序。这样才能添加/usr/bin/cc和其他工具的链接。

撰写回答