Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'BluetoothDispatcher' from 'able' #18

Closed
Enkumicahel opened this issue Nov 10, 2020 · 4 comments
Closed

Comments

@Enkumicahel
Copy link

Hello,

Using Buildozer to build my Kivy app with the ABLE library, but after following every instruction given in here, I get this at the end of the Bulldozer log.

python : ImportError: cannot import name 'BluetoothDispatcher' from 'able' (/data/user/0/org.test.bleable/files/app/_python_bundle/site-packages/able/init.pyc)

I have already included the following in my buildozer.spec file:
requirements = python3,kivy,android,able,lictionary,tatsu
p4a.local_recipes = ../recipes

what am I missing?

@b3b
Copy link
Owner

b3b commented Nov 10, 2020

Hello,

Line p4a.local_recipes = ../recipes assumes that that there is recipes directory one level above the build directory.
It could be checked by running ls ../recipes/able/ from the build directory.

Seems like in your case this directory was missed.
But, PyPi has package with the name able - non related to this library. And this package was installed instead.

To fix the issue, you can change p4a.local_recipes to point to the directory with the able recipe.

@Enkumicahel
Copy link
Author

I thought so, but I tried to import the non-related PyPi able package to check if it exists but, it doesn't exist.

as for the ls ../recipes/able/
it returns the contents of the directory

To fix the issue, you can change p4a.local_recipes to point to the directory with the able recipe.

already done that.

@b3b
Copy link
Owner

b3b commented Nov 11, 2020

lictionary,tatsu in requirements are PyPi package dependencies, so this library was involved.

One more way to check that wrong library was used, is by checking the output of the
ls ./.buildozer/android/platform/*/dists/*/_python_bundle/_python_bundle/site-packages/able
In case of able-recipe this directory contains android, and in case of PyPi library it contains grammar.ebnf.

Maybe running buildozer android clean before the next building attempt will help.

@Enkumicahel
Copy link
Author

Enkumicahel commented Nov 11, 2020

I think I am on the same page as you have mentioned above. But, now I was able to take the java interface and GATT implementation code and redesign my code to directly interact with that. So, I am good to go. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants