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

时间:2017-09-15 01:25:28

标签: android python kivy buildozer

在android项目的python中,我发现了pil配方 https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/pil/init.py

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

不是python3的python3crystax !! 所以我试图弄清楚它并将我的python3crystax添加到buildozer规范文件中的要求,但出现错误(如预期的那样)

我错过了什么

***** ****误差

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

3 个答案:

答案 0 :(得分:1)

看起来这里的python3crystax可选要求是一个错误。我会删除它。

我已经看到了枕头食谱的建议,但还没有人将其纳入食谱中。如果你愿意,你可以找到一个可以使用的。

答案 1 :(得分:1)

不,PIL不支持Python 3。

version 2.0.0 released on 15th March 2013中,Pillow(维护的PIL分支)中添加了Python 3支持。

添加Python 3支持是一项非常大的工作,更改了230个文件。请参阅pull request

答案 2 :(得分:0)

我不熟悉python-for-android和“python3crystax”。但在PIL website它说

  

目前的免费版本是PIL 1.1.7。此版本支持Python 1.5.2及更高版本,包括2.5和2.6。 3.X的版本将在稍后发布。