【发布时间】:2011-09-13 19:14:17
【问题描述】:
我正在构建我的第一个 Python 程序 :) 但是,我安装了 Python 3.2 而不是 2.7,因为较新的版本包含 TkInter。现在我找不到在其中使用 PIL 的方法。
我已阅读this question,但作为一个全新的人,这对我没有多大帮助。我安装了 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 并支持 Python 3 的 PNG 和 JPEG?
一种选择是下载旧版本的 Python,但不会有TkInter?
我希望你能理解我是一个新人,所以如果我提出任何愚蠢的问题,请原谅我。 Python 看起来真的很酷! ;) 任何帮助表示赞赏。
【问题讨论】:
-
看看这个unofficial packages,他们应该在py3k上工作。
-
另外,
tkinter也带有 Python 2.7,docs.python.org/library/tkinter.html,只是组织/命名不同。
标签: python python-3.x tkinter