gpt4 book ai didi

python - pip install PIL -E TICKETS-1 - 不支持 JPEG/PNG

转载 作者:IT老高 更新时间:2023-10-28 22:19:18 31 4
gpt4 key购买 nike

我在 Django 项目中使用 Ubuntu 和 VitualEnv。

我使用 Synaptic 包管理器安装了 PIL 库,它工作正常。但是当我创建一个 VitrualEnv 并尝试使用 pip 安装 PIL 时,它会安装但我得到了这个奇怪的行为:

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2]
--------------------------------------------------------------------
*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

我希望我可以将 requirements.txt 用于我的所有依赖项,但可能必须以某种方式手动安装 PIL ......但是如何?

编辑:谢谢 John Keyes,你说得对,我跑了:

sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/

再次尝试安装 PIL 后,我得到:

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
- -------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

编辑:您可能需要安装 libfreetype6-dev libjpeg8-dev

编辑:另一个不错的选择是使用 Pillow而不是 PIL

最佳答案

这个 thread on ubuntu forums涵盖了这个话题。

关于python - pip install PIL -E TICKETS-1 - 不支持 JPEG/PNG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7648200/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com