Dlib in Buildozer

160 views
Skip to first unread message

Eder Santana

unread,
Jun 21, 2019, 1:54:54 PM6/21/19
to Kivy users support
Hello,

I have a python application that makes use of Kivy, opencv, numpy and dlib. For the first three I got import success during the packaging, however for the dlib libbioteca, which is developed in C ++ the buildozer presents import error. Reading on some forums I found that for cases like this, I would have to create a p4a recipe. I would like to know how to make this recipe and what should be done with it after its creation.

Robert Flatt

unread,
Jun 21, 2019, 10:11:14 PM6/21/19
to Kivy users support
The "after it's creation" part is easy, there is a mechanism for a locally specified recipes (overrides defaults too)
1) specify '--requirements my_recipe'
2) Create a directory 'p4a-recipes' in your project directory (This works for p4a, I don't know about Buildozer)
3) place your recipe there. ('p4a-recipes/my_recipe/__init__.py')

"How to" seems is not so clear
   Beware this documentation may be obsolete  :(
2) Figure it out from the existing examples

If I were you I would want better information than this ;)  Maybe somebody else knows?

Alexander Taylor

unread,
Jun 22, 2019, 12:13:15 PM6/22/19
to Kivy users support
The basic recipe structure you want is along hte lines of

from pythonforandroid.recipe import Recipe, CppCompiledComponentsPythonRecipe
from pythonforandroid.logger import shprint

from os.path import join

import sh


class DlibRecipe(CppCompiledComponentsPythonRecipe):
    name
= 'dlib'
    version
= '19.17'
    url
= 'https://github.com/davisking/dlib/archive/v{version}.zip'

    depends
= ['setuptools']

recipe
= DlibRecipe()

I tried this and quickly hit a compile error though. I don't know what was wrong, or how much effort it would be to make it work.

Eder Santana

unread,
Jun 24, 2019, 1:06:27 PM6/24/19
to Kivy users support
Hello,

Following this is logical, in the buildozer then the requirements would be:

# (list) Application requirements
# comma separated e.g.
requirements = sqlite3, kivy
requirements = python3, kivy, opencv-python



# (str) Custom source folders for requirements
# Custom Sets for any requirements with recipes
# requirements.source.kivy = ../../kivy
requirements.source.kivy = p4a-recipes / dlib

Is correct?

Eder Santana

unread,
Jun 24, 2019, 1:18:07 PM6/24/19
to Kivy users support
Hello,

Have you just referenced the recipe on buildozer requirements? I created a 'p4a-recipes' directory in my project directory, put my recipe into it and listed it in:

requirements.source.kivy = p4a-recipes / dlib

Is that how you did the test?

Robert Flatt

unread,
Jun 24, 2019, 8:35:59 PM6/24/19
to Kivy users support
For p4a just create the directory, nothing else to specify. As I said earlier I know nothing of Bulldozer.
I found this feature by browsing the source:

NETTESH JASARATH

unread,
Jun 27, 2019, 2:22:23 AM6/27/19
to kivy-...@googlegroups.com
Hello ,I'm using windows 8 and when I run buildozer I'm getting an error -'Buildozer' object has no attribute 'translate_target',and I can't find where the buildozer.spec file is created .please suggest me any solution .

--
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.
To post to this group, send email to kivy-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kivy-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/92e90de6-b676-4de9-a530-26bee1333bf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages