pandas - 通过 buildozer 的 Android 应用程序:需求与配方
问题描述
我尝试部署一个 android 应用程序。我在 python 中使用 kivy 框架和 buildozer。我的问题是包含熊猫库。这是我简单且有效的测试代码:
from kivy.app import App
from kivy.uix.label import Label
import kivy
kivy.require('1.11.1')
import pandas as pd
class TestLibraries(App):
def build(self):
df = pd.DataFrame()
df.loc[0, 'text'] = 'this is pandas'
return Label(text = df.loc[0, 'text'])
if __name__ == '__main__':
TestLibraries().run()
下一步是定义 buildozer .spec 文件。在这里我看到两个选项:
- 通过要求:所以我像这样修改 .spec 文件
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==1.11.1,pandas
这很好用。2. 通过食谱:我从github获取食谱。并将其放入我的名为 recipe 的文件夹中。之后我像这样修改.spec文件
# (str) The directory in which python-for-android should look for your own build recipes (if any)
p4a.local_recipes = /PATH_TO_FOLDER/recipe/
在 buildozer 日志文件中,我可以阅读:
Listing '/PATH_TO_FOLDER/.buildozer/android/app/recipe/pandas'...
Compiling 'PATH_TO_FOLDER/.buildozer/android/app/recipe/pandas/__init__.py'...
因此 buildozer 找到了配方,但未安装该库并且该应用程序无法正常工作。
问题是:为什么不呢?
您可能会要求我使用第二个选项,因为第一个选项效果很好。下一步我想写一个新的食谱。所以我必须学习如何正确地包含现有的食谱。
我希望你能理解我的问题并给一些建议。
谢谢卡帕
解决方案
推荐阅读
- python - 如何使数组输入循环进入数据框
- vim - 无法在 RHEL7 上打开“gvim”
- android - 屏幕上和 Android 模拟器之间的鼠标指针偏移
- linux - 有没有办法在同一个 bash shell 脚本中包含不同的路径
- python - 机器学习算法的对数似然函数
- javascript - 当两个服务都属于同一个模块时,如何将一个nestjs服务注入另一个服务?
- ansible - ansible-galaxy 安装 ahuffman.resolv 不起作用
- windows - 调试凭据提供程序崩溃
- nginx - 请求正文未传入 http url,但它存在于 https url
- pyspark - pysprak - 微批处理流式增量表作为对另一个增量表执行合并的源 - 未调用 foreachbatch