Windows 上适用于 Python 3.2 的 PIL 还是替代方案?

发布于 2024-12-04 13:00:31 字数 1192 浏览 4 评论 0原文

我正在构建我的第一个 Python 程序 :) 但是,我安装了 Python 3.2 而不是 2.7,因为较新的版本包含了 TkInter。现在我找不到在其中使用PIL的方法。

我已阅读这个问题,但作为一个完全的新手,这对我来说没有太大帮助。我安装了 zlib 和 libjpeg,但在构建 pil-py3k 时无法进一步进行。我不知道我应该在这里做什么:

# --------------------------------------------------------------------
# Library pointers.
#
# Use None to look for the libraries in well-known library locations.
# Use a string to specify a single directory, for both the library and
# the include files.  Use a tuple to specify separate directories:
# (libpath, includepath).  Examples:
#
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

FREETYPE_ROOT = None
JPEG_ROOT = None
TIFF_ROOT = None
ZLIB_ROOT = None
TCL_ROOT = None

是否有一种更简单的方法来启用 PIL with PNG and JPEG support for Python 3?

一种选择是下载旧版本的 Python,但这样就不会出现 TkInter 了?

我希望你能理解我是一个新人,所以如果我提出任何愚蠢的问题,请原谅我。 Python 看起来真的很酷! ;) 如有任何帮助,我们将不胜感激。

I'm building my first Python program :) However, I installed Python 3.2 instead of 2.7, as the newer version has TkInter included. Now I can't find a way to use PIL in it.

I have read this question but as a total newcomer it's not much help for me. I installed zlib and the libjpeg but couldn't get any further when it comes to building the pil-py3k. I have no idea what I am supposed to do in here:

# --------------------------------------------------------------------
# Library pointers.
#
# Use None to look for the libraries in well-known library locations.
# Use a string to specify a single directory, for both the library and
# the include files.  Use a tuple to specify separate directories:
# (libpath, includepath).  Examples:
#
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

FREETYPE_ROOT = None
JPEG_ROOT = None
TIFF_ROOT = None
ZLIB_ROOT = None
TCL_ROOT = None

Is there an easier way to enable PIL with PNG and JPEG support for Python 3?

One option is to download an older version of Python but then there won't be TkInter?

I wish you understand I'm a newcomer so please forgive me if I make any stupid questions. Python seems really cool! ;) Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

绿萝 2024-12-11 13:00:31

Python 3.2 的非官方 PIL 就是答案
http://www.lfd.uci.edu/~gohlke/pythonlibs/

Unofficial PIL for Python 3.2 is the answer
http://www.lfd.uci.edu/~gohlke/pythonlibs/

家住魔仙堡 2024-12-11 13:00:31

刚刚发现有PIL fork Pillow: https://pypi.python.org/pypi /枕头/2.1.0

Just found out that there is PIL fork Pillow: https://pypi.python.org/pypi/Pillow/2.1.0

依 靠 2024-12-11 13:00:31

正如 agf 在对你的问题的评论中提到的,tkinter 多年来一直包含在 Python 的每个版本中。重要的区别是 tkinter 包的重组。其中最大的变化是基础包名称:在 Python 3.x 中,tkinter 包名为 tkinter,而在 Python 2.x 中,该包名为 Tkinter (注意大写“T”)。您可以参阅 tkinter 上的 Python 2.7.2 文档 了解更多信息。

不幸的是,我还没有在 Python 3.x 中使用 PIL,所以我不能提供任何帮助,但希望您可以在 2.7 中完成您需要的东西。

As agf mentioned in his comment on your question, tkinter has been included with every version of Python for years. The important difference is a restructuring of the tkinter packages. The biggest of those changes is the base package name: In Python 3.x, the tkinter package is named tkinter, while in Python 2.x, the package is named Tkinter (note the capital "T"). You can see the Python 2.7.2 docs on tkinter for more information.

Unfortunately, I haven't used PIL with Python 3.x, so I can't be of any assistance there, but hopefully you can accomplish what you need in 2.7 instead.

慈悲佛祖 2024-12-11 13:00:31

请参阅http://mail.python.org/pipermail/image- sig/2012-October/007080.html 用于在 Python 2+3 上工作的更新端口

See http://mail.python.org/pipermail/image-sig/2012-October/007080.html for an updated port that works on Python 2+3

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文