我正在构建我的第一个Python程序:)然而,我安装的是Python3.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支持PNG和JPEG对Python3的支持?
一种选择是下载较旧版本的Python,但这样就不会有TkInter
我希望你能理解我是个新人,所以如果我问了一些愚蠢的问题,请原谅。Python看起来真的很酷!;)感谢任何帮助。
发布于 2011-11-15 13:35:12
Python3.2的非官方PIL是答案http://www.lfd.uci.edu/~gohlke/pythonlibs/
发布于 2013-08-04 02:03:14
发布于 2011-10-26 04:45:40
正如agf在他对你的问题的评论中提到的那样,tkinter多年来一直包含在每个版本的Python中。重要的区别是tkinter包的重组。其中最大的变化是基本包名:在Python3.x中,tkinter包名为tkinter,而在Python2.x中,包名为Tkinter (注意大写"T")。您可以在tkinter上查看Python 2.7.2 docs以了解更多信息。
不幸的是,我还没有在Python3.x中使用过PIL,所以在这方面我不能提供任何帮助,但希望您能在2.7中完成所需的工作。
https://stackoverflow.com/questions/7407185
复制相似问题