2

i try to deploy an android app. I work with the kivy framework and buildozer in python. My issue is to include the pandas library. This is my simple and working test code:

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()

The next step is do define the buildozer .spec file. Here i see two options:

  1. Via requirements: So i modify the .spec file like this
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==1.11.1,pandas

This works very well. 2. Via recipe: I take the recipe from github. and put it into my folder called recipe. After that i modify the .spec file like this

# (str) The directory in which python-for-android should look for your own build recipes (if any)
p4a.local_recipes = /PATH_TO_FOLDER/recipe/

In the buildozer logfile i can read:

Listing '/PATH_TO_FOLDER/.buildozer/android/app/recipe/pandas'...
Compiling 'PATH_TO_FOLDER/.buildozer/android/app/recipe/pandas/__init__.py'...

So buildozer found the recipe but the library is not installed and the app dosen't works.

And the question is: why not?

You might ask me for using the second option because the first option works very well. In the next step i want to write a new recipe. So i have to learn how to include an existing recipe correctly.

I hope you unterstand my problem an have some advices.

Thanks Capa

Capa
  • 31
  • 6
  • I don't think the lines you posted show the recipe being used. Post the full log. – inclement Aug 06 '20 at 19:34
  • I would like to post the full log, but "Body is limited to 30000 characters; you entered 1683219." what can i do? – Capa Aug 07 '20 at 17:16
  • Use a pastebin site – inclement Aug 07 '20 at 17:25
  • Thank you :-) Here it is: https://paste2.org/n39CNzFn – Capa Aug 07 '20 at 18:06
  • Can you clean everything, build again, and post a log of the full build? – inclement Aug 07 '20 at 18:26
  • "Clean everything" will mean delete the .buildozer folder and deploy again? If yes so i can... – Capa Aug 07 '20 at 18:38
  • Here it is: https://paste2.org/IafcCYNw – Capa Aug 07 '20 at 18:55
  • `--requirements=python3,kivy==1.11.1 ` <- doesn't look like you're attempting to build pandas – inclement Aug 07 '20 at 19:13
  • This is option 1 in the initial problem decription. If i set pandas in the requirements, i don't need to use the recipe. Do you say that i have to set both the requirement and recipe if i want to use a recipe? – Capa Aug 07 '20 at 19:18
  • 1
    I think you've misunderstood what recipes are. They are programmatic build instructions for how to compile pandas for android. When you specify something in your requirements, it is built using a recipe if a recipe is available. If you don't specify something in your requirements, it isn't built/included at all. – inclement Aug 07 '20 at 19:32
  • Ok i understand what does it stand for. For my app i need to write a recipe to use the scikit-learn libraries. So i add "scikit-learn" to the requirements and write a recipe called "scikit-learn" to define how to build. Right? – Capa Aug 07 '20 at 19:50
  • Yes. Warning in advance: it is probably hard to make a recipe for scikit-learn. – inclement Aug 07 '20 at 20:21
  • Is this the reason why such a recipe does not exist? You know why it hard to make that recipe? – Capa Aug 07 '20 at 20:24
  • It's probably a relatively complicated library with various compiled components and dependencies that must be carefully navigated. – inclement Aug 07 '20 at 20:37

0 Answers0