【问题标题】:PIL for Python 3.2 on Windows or alternatives?PIL for Python 3.2 on Windows 还是替代品?
【发布时间】: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 看起来真的很酷! ;) 任何帮助表示赞赏。

【问题讨论】:

标签: python python-3.x tkinter


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    【讨论】:

      【解决方案3】:

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

      很遗憾,我没有在 Python 3.x 中使用 PIL,因此我无法提供任何帮助,但希望您可以在 2.7 中完成您需要的工作。

      【讨论】:

        【解决方案4】:

        有关适用于 Python 2+3 的更新端口,请参阅 http://mail.python.org/pipermail/image-sig/2012-October/007080.html

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-09-10
          • 1970-01-01
          • 1970-01-01
          • 2023-04-03
          • 2011-06-05
          相关资源
          最近更新 更多