buildozer - How do I specify module ?

217 views
Skip to first unread message

Iain Simpson

unread,
Jan 11, 2017, 11:03:51 AM1/11/17
to Kivy users support
I have just started trying to transfer my first working kivy program from Linux (Linux Mint 18 (Ubuntu 16.10)) to android.
I've got buildozer to install app on tablet(Kindle fire hd 7") but it fails when I try to run.

using  buildozer android logcat
I get :

01-11 13:54:07.712 10312 10335 I python  : Android kivy bootstrap done. __name__ is __main__
01-11 13:54:07.712 10312 10335 I python  : Run user program, change dir and execute main.py
01-11 13:54:07.994 10312 10335 I python  : [INFO              ] [Logger      ] Record log in /data/data/org.test.caa/files/.kivy/logs/kivy_17-01-11_4.txt
01-11 13:54:07.994 10312 10335 I python  : [INFO              ] [Kivy        ] v1.9.1
01-11 13:54:07.994 10312 10335 I python  : [INFO              ] [Python      ] v2.7.2 (default, Jan 10 2017, 22:39:10) 
01-11 13:54:07.994 10312 10335 I python  : [GCC 4.8]
01-11 13:54:08.033 10312 10335 I python  : [INFO              ] [Factory     ] 179 symbols loaded
01-11 13:54:08.158   659 10228 I kinguser_jni: decLen = 512
01-11 13:54:08.564   659 10348 V ContextImpl: Implicit intents with startService are not safe: Intent { act=com.tencent.qqpimsecure.TMS_LITE_SERVICE (has extras) } android.content.ContextWrapper.bindService:552 com.kingroot.kinguser.aey.run:88 java.lang.Thread.run:841 
01-11 13:54:08.595   459   814 W ActivityManager: Unable to start service Intent { act=com.tencent.qqpimsecure.TMS_LITE_SERVICE (has extras) } U=0: not found
01-11 13:54:08.892 10312 10335 I python  :  /data/data/org.test.caa/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:13: RuntimeWarning: import cdrom: No module named cdrom
01-11 13:54:08.900 10312 10335 I python  :  (ImportError: No module named cdrom)
01-11 13:54:08.916 10312 10335 I python  : [INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
01-11 13:54:08.947 10312 10335 I python  : [INFO              ] [Text        ] Provider: pygame
01-11 13:54:09.009 10312 10335 I python  :  Traceback (most recent call last):
01-11 13:54:09.009 10312 10335 I python  :    File "/home/iain/Data/iain/workspace/kivy/2nd_attempt/.buildozer/android/app/main.py", line 18, in <module>
01-11 13:54:09.009 10312 10335 I python  :  ImportError: No module named KivyCalendar
01-11 13:54:09.056 10312 10335 I python  : Python for android ended.
01-11 13:54:09.056 10312 10335 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.

which seems to indicate that it is looking for KivyCalendar.
This module is loaded as normal  - in './usr/local/lib/python2.7/dist-packages/KivyCalendar'

"version = '0.1' 
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.stacklayout import StackLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.relativelayout import RelativeLayout

from kivy.uix.label import Label

from kivy.properties import ObjectProperty, ListProperty, StringProperty, NumericProperty
from kivy.network.urlrequest import UrlRequest
from kivy.uix.listview import ListItemButton
from kivy.factory import Factory
from KivyCalendar import DatePicker

from kivy.core.window import Window"


Do I need to specify it in some other way ?

Sorry if this is an elementary problem but I'm still finding my way around the documentation
Thanks

Andreas Ecker

unread,
Jan 11, 2017, 11:44:53 AM1/11/17
to kivy-...@googlegroups.com
Not sure without seeing the content of your buildozer.spec but looks like you were missing to add the KivyCalendar package to your requirements setting.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Iain Simpson

unread,
Jan 11, 2017, 6:02:29 PM1/11/17
to Kivy users support
I am attaching buildozer.spec

I haven't done anything special for KivyCalendar as a I assumed that it would be picked up from  the python 'library' ('./usr/local/lib/python2.7/dist-packages/KivyCalendar'.
This is where I feel that I'm missing something fundemental.
Can someone point me at  a suitable document/tutorial ?

Thanks for your help

Iain
buildozer.spec

Alexander Taylor

unread,
Jan 11, 2017, 6:21:13 PM1/11/17
to Kivy users support
buildozer doesn't know about or use anything from your local python installation, as it is building a new python distribution for the Android environment. As such, you must tell it about all packages you want to include. If the package is pure python and available on pip, you can include it in the requirements line of buildozer.spec.

Iain Simpson

unread,
Jan 12, 2017, 6:38:26 AM1/12/17
to Kivy users support
Thanks Alexander - that makes sense
I added KivyCalendar to requirements line

Enter code here...

# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = kivy,KivyCalendar


but I now get 
Enter code here...# Cwd /home/iain/Data/iain/workspace/kivy/2nd_attempt/.buildozer
Collecting KivyCalendar
  Using cached KivyCalendar-0.1.3.tar.gz
Collecting kivy (from KivyCalendar)
  Downloading kivy-1.9.1.tar.gz (16.4MB)
    Complete output from command python setup.py egg_info:
    Using distutils
        Cython is missing, its required for compiling kivy !
       
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-K0It5D/kivy/setup.py", line 184, in <module>
        from Cython.Distutils import build_ext
    ImportError: No module named Cython.Distutils
        ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-K0It5D/kivy/
# Command failed: pip install --target=/home/iain/Data/iain/workspace/kivy/2nd_attempt/.buildozer/applibs KivyCalendar

Earlier in the log  (attached as log1201.txt) it confirmed that cython was found at '/usr/bin/cython'

googling finds a number of references to (spurious?) 'No module named Cython.Distutils' messages but no definate cure.




log1201.txt
Reply all
Reply to author
Forward
0 new messages