如何为Android Kivy添加模块? [英] How do I add a module to Kivy For Android?

查看:127
本文介绍了如何为Android Kivy添加模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android设备上安装了Kivy,但是help('modules')显示未安装PIL模块. 如何添加?

I installed Kivy on my Android device, but help('modules') shows that PIL module is not installed. How can I add it?

我的意思是,我安装了kivy-launcher并编写了一个小型测试应用程序,它可以工作. 现在,如果我的应用程序需要一个不可用的模块怎么办? 为了查看可用的模块,我安装了PyCo,这是一个用于kivy的Python控制台.

edit: I mean, I installed kivy-launcher and written a small test application and it works. Now what if my app require a module not available? To see which modules are available I installed PyCo, a Python Console for kivy.

现在我还用python解释器安装了QPython和SL4A:我是否需要所有这些混乱才能编写一个需要附加模块的应用程序?

Now I also installed QPython and SL4A with python interpreter: do I need all of this mess to write a single app which requires an additional module?

我根本不擅长Linux和APK编译,这就是为什么我要寻找一种直接在设备上开发方法的原因.

I'm not skilled at all in Linux and in compiling APKs, that's why I'm looking for a metod to develop directly on device.

推荐答案

安装的Kivy"到底是什么意思?

What exactly do you mean by 'installed Kivy'?

通常,当使用python-for-android为kivy为android编译kivy时,第一步是使用所需的任何模块创建android python发行版. 此处的说明在从kivy项目构建apk时提供了有关此过程的一些信息,相关行指定要使用的模块为./distribute.sh -m "pil kivy".

In general, when kivy is compiled for android using python-for-android the first step is to create an android python distribution with any modules you require. The instructions here give some information on this process when building an apk from a kivy project, with the relevant line specifying what modules to use being ./distribute.sh -m "pil kivy".

编译适用于Android的python发行版时,如果存在针对它们的配方,则只能指定要编译的模块. 此处.

When compiling a python-for-android distribution, you can only specify modules for compilation if a recipe exists for them. Current recipes at here.

通常,只需在项目目录中包含纯python模块即可.

You can also in general include pure python modules by just including them in your project directory.

Edit2(1月14日):现在有点过时了,最新版本的python-for-android将自动尝试通过pip安装无法识别的依赖项.

Edit2 (Jan 14): This is now a little out of date, recent versions of python-for-android will automatically try to install unrecognised dependencies via pip.

这篇关于如何为Android Kivy添加模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆