如何使用自制程序在系统库中安装PIL?
在新的 SnowLeopard 安装中,我想使用自制程序来安装 PIL。然而,该配方将 PIL 安装在 cellar 下,而不是在 /Library/Python/2.6/site-packages 中。有没有办法改变安装目录?
In a new SnowLeopard install, I'd like to use homebrew to install PIL. However the recipe installs PIL under cellar instead of in /Library/Python/2.6/site-packages. Is there a way to change the install directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以创建一个符号链接,而不是安装 pip 和另一个 PIL。
在 Lion 上测试,在 Snow Leopard 上,您可能需要更改路径以使用 /python2.6 /Python/2.6。
Instead of installing pip and another PIL, you can just make a symlink
Tested on Lion, on Snow Leopard, you may need to change paths to use /python2.6 /Python/2.6.
看来Pillow在自制软件中取代了PIL。新命令是:
It seems that Pillow replaced PIL in homebrew. The new command is:
由于似乎没有“可接受的”方式将自制程序鸡蛋安装到系统站点包中,因此我最终做了以下事情:
自制程序安装获取并安装所有 PIL 的依赖项(尤其是 jpeg)。随后的 easy_install 在为系统站点包编译 PIL 时会使用它们。 Freetype 支持不会出现在“易于安装”的版本中,但这对于我的目的来说已经足够了。
由于我最初的目标是为网页设计师提供一种简单的方法来构建 django 开发环境,因此安装未使用的自制 PIL 并不是什么问题。
希望这对某人有帮助。仍然希望有更好的答案。
Since there seems to be no "accepted" way of installing homebrew eggs into the system site-packages, here is what I ended up doing:
The homebrew install grabs and installs all of PIL's dependencies (especially jpeg). The later easy_install then uses them when compiling PIL for the system site-packages. Freetype support doesn't show up in the "easy-installed" version, but that's fine for my purposes.
As my initial goal was to provide a simple way for a web designer to build a django development environment, having an unused homebrew PIL installed is not really a problem.
Hope this helps someone. Still hoping there's a better answer out there.
正如@BarnabasSzabolcs 提到的,新版本名为“pillow”。
brew install Homebrew/python/pillow
的替代方案是pip installpillow
。您可能需要添加 sudo ,具体取决于您的 python 环境权限。As @BarnabasSzabolcs mentioned, newer versions named pillow.
an alternative to
brew install Homebrew/python/pillow
ispip install pillow
. You may need to addsudo
, depends on your python environment permissions.对于现在阅读本文的每个人来说,今天这可以通过
brew installpillow
来实现。For everyone reading this now, today this can be achieved with
brew install pillow
.