无法在Cygwin Python for Windows上安装Pillow

时间:2014-07-03 15:00:46

标签: python windows pip pillow

我尝试使用pip install Pillow通过Cygwin在Windows上安装最新版本的Pillow,但是收到错误消息:

In file included from _imagingtk.c:19:0:

/usr/include/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory

 # include <X11/Xlib.h>

                       ^

compilation terminated.

In file included from Tk/tkImaging.c:52:0:

/usr/include/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory

 # include <X11/Xlib.h>

                       ^

compilation terminated.

Building using 8 processes

gcc -shared -Wl,--enable-auto-image-base -L. build/temp.cygwin-1.7.30-x86_64-2.7/_imagingtk.o build/temp.cygwin-1.7.30-x86_64-2.7/Tk/tkImaging.o -L/usr/lib
-L/usr/lib/python2.7/config -L/usr/local/lib -L/usr/lib/python2.7/config -ltcl8.5 -ltk8.5 -lpython2.7 -o build/lib.cygwin-1.7.30-x86_64-2.7/PIL/_imagingtk.dll

gcc: error: build/temp.cygwin-1.7.30-x86_64-2.7/_imagingtk.o: No such file or directory

gcc: error: build/temp.cygwin-1.7.30-x86_64-2.7/Tk/tkImaging.o: No such file or directory

error: command 'gcc' failed with exit status 1

---------------------------------------- Cleaning up... Command /usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip_build_User /pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7Gv1dT-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_User/pillow

Traceback (most recent call last):   File "/usr/bin/pip", line 11, in <module>
    sys.exit(main())   File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)   File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 35: ordinal not in range(128)

它失败了,因为它无法找到X11,这特别令人困惑,因为我在Windows计算机上而X11是Linux软件。我不喜欢依赖预编译版本,因为没有支持。

1 个答案:

答案 0 :(得分:-4)

与往常一样,这里的答案是抛弃Cygwin并使用更好的外壳。