【问题标题】:Can PIL be used in python 3 (not pillow)PIL可以在python 3中使用(不是枕头)
【发布时间】:2017-09-18 04:52:21
【问题描述】:

在 python for android 项目中,我在 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

【问题讨论】:

    标签: android python kivy buildozer


    【解决方案1】:

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

    我见过有人提出过枕头食谱,但还没有一个人将其纳入食谱。如果您愿意,您可能可以找到一个使用。

    【讨论】:

      【解决方案2】:

      不,PIL 不支持 Python 3。

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

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

      【讨论】:

        【解决方案3】:

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

        当前的免费版本是 PIL 1.1.7。此版本支持 Python 1.5.2 和更新版本,包括 2.5 和 2.6。稍后会发布 3.X 版本。

        【讨论】:

        • PIL 网站自2010 以来已表示。从那时起,CPython 2.5 和 2.6 都是EOL
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-05
        • 1970-01-01
        • 2020-11-29
        • 1970-01-01
        相关资源
        最近更新 更多