Re: Creating an apk that depends on pandas

860 visualizações
Pular para a primeira mensagem não lida
A mensagem foi excluída

Alexander Taylor

não lida,
12 de jun. de 2016, 19:38:0112/06/2016
para Kivy users support
I strongly recommend using the new toolchain if you're writing recipes. It's not just new, it's the version under development, and the old one is essentially deprecated. It also has a more sophisticated recipe system.

The point of recipes is (mostly) to compile code, but targeting the android environment (in the old toolchain, managed by push_arm and pop_arm, or in the new toolchain by passing env vars explicitly to shell commands). In this context, 'pure python' recipes are those that don't need compliation - if they're just python code, they'll run without modification within the python interpreter running on Android.

You can't use local libraries in this compilation.

There's some documentation on recipe creation at http://python-for-android.readthedocs.io/en/latest/ , which you might find useful. Pandas is probably a big target and might need patching (I haven't checked though), it might be a good learning exercise to start with something simpler, e.g. porting a recipe from the old toolchain to the new one.


On Friday, 10 June 2016 19:10:44 UTC+1, morg...@udayton.edu wrote:
Hello! 
 
I'm a new time user to kivy and python for android. I primarily use a virtual box (Ubuntu 64-bit) with buildozer.vdi setup. Moving my application to my android has been challenging. My main.py relies on an import of pandas to handle data correctly. Pandas also relies on dependencies like numpy, pytz, and python-dateutil. 

Therefore, from what I understand after hours of trial and error (and please feel free to correct me!), I am to create a recipe for pandas because I cannot simply add it to my .spec requirements unless I have a recipe or it is pure python. I've been using the version of python-for-android from the old toolchain branch. I've made a 'pandas' directory in the local python-for-android folder and set the android.p4a_dir in my buildozer.spec to point at it. That being said, all recipes are done in .sh formatting (a format not used in the new master python-for-android, making this part harder to research). Because of this formatting issue and perhaps my lack of knowledge creating .sh files, I'm ultimately stuck here. Attatched is my recipe.sh. Notice how I have no idea how to set up my functions!!

Packaging the application running 'buildozer android debug' doesn't lead me into any problems. I can see in the log that it recognizes pandas as an available module (because it's a directory in python-for-android/recipes). Upon opening the application with pandas imported in the main.py, the app will close after the presplash screen. Attached is also the buildozer.spec file

I can get the application running so long as the only imports in my main.py are kivy related because kivy is set by default as a requirement in the buildozer.spec and has a recipe, of course. I would like to stick to this old toolchain version of python-for-android.

Finally, my main questions: 
  • How can I fix the recipe.sh to import pandas? 
    • should my pandas recipe.sh include code to find and install all dependencies?
  • Can I call on local copies of the libs in my usr/local/lib/python27/dist-packages ??
  • Does it matter the script was made in python 3.5 if it works fine in python 2.7?
  • (in general) what makes a package 'pure-python' ? Is it considered pure if it has no dependencies? 
Thank you! If I wasn't clear enough please tell me! If I sound like I know what I'm talking about, I really do not! If you have a fix, please give a fair description of what you're doing and why, because I want to learn from my shortcomings! 

TL;DR: buildozer + old toolchain python-for-android, main.py imports pandas and kivy, kivy works and pandas doesnt, help me make a recipe so pandas works.

Jeff

não lida,
4 de jul. de 2017, 13:08:2804/07/2017
para Kivy users support
Hi, I have been struggling with this for a while now, please let me know if you came right with a solution.

John Green

não lida,
27 de jun. de 2018, 10:21:4127/06/2018
para Kivy users support
I too need pandas in my app on python 3 using crystax-ndk. anyone any further forward with this? 
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem