简体   繁体   English

可以在python 3中使用PIL(不是枕头)

[英]Can PIL be used in python 3 (not pillow)

In python for android project , I found in pil recipe https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/pil/ init .py 在python for android项目中,我在pil配方https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/pil/ init .py中找到了

depends = [('python2', 'python3crystax'), 'png', 'jpeg']

Isn't python3crystax for python3!! python3不是python3crystax !! so i tried to figure it and I added python3crystax to the requirements in buildozer spec file, but error appeares(as expected) 所以我试图弄清楚它,并在buildozer spec文件中的要求中添加了python3crystax,但出现了错误(如预期的那样)

Am i missing something 我错过了什么吗

*****error**** *****错误****

INFO]: Building compiled components in pil
[INFO]: -> directory context /home/sherif/Desktop/Project/.buildozer/android/platform/build/build/other_builds/pil-python3crystax/armeabi-v7a/pil
[INFO]: -> running python3.5 setup.py build_ext -v
working: File "setup.Exception in thread background thread for pid 27914:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_1:

RAN: /usr/bin/python3.5 setup.py build_ext -v

STDOUT:
File "setup.py", line 159
print "--- using Tcl/Tk libraries at", TCL_ROOT
^
SyntaxError: Missing parentheses in call to 'print'

STDERR:

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code

It looks like the python3crystax optional requirement here is a mistake. 看起来python3crystax可选要求在这里是一个错误。 I'll remove it. 我将其删除。

I've seen pillow recipes proposed, but none have made it into the recipes yet. 我见过提议的枕头食谱,但是还没有一个食谱。 You can probably find one to use if you like. 如果愿意,您可能会找到一个要使用的。

No, PIL does not support Python 3. 不,PIL不支持Python 3。

Python 3 support was added in Pillow, the maintained PIL fork, in version 2.0.0 released on 15th March 2013 . 2013年3月15日发布的2.0.0版 Pillow(维护的PIL分支)中添加了对Python 3的支持。

It was quite a big effort adding Python 3 support, with 230 files changed. 添加Python 3支持是一项巨大的努力,更改了230个文件。 See the pull request . 参见拉取请求

I'm not familiar with python-for-android and "python3crystax". 我对python-for-android和“ python3crystax”不熟悉。 But on PIL website it says 但在PIL网站上却说

The current free version is PIL 1.1.7. 当前的免费版本是PIL 1.1.7。 This release supports Python 1.5.2 and newer, including 2.5 and 2.6. 此版本支持Python 1.5.2和更高版本,包括2.5和2.6。 A version for 3.X will be released later. 3.X的版本将在以后发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM