pyodbc Buildozer Linux error missing sql.h

177 views
Skip to first unread message

Andrew A

unread,
Sep 23, 2020, 2:28:09 AM9/23/20
to Kivy users support
Hello,

I am trying to deploy my kivy app to Android with Buildozer running on a linux virtual machine. 
Problem strikes when I try to build my app where it said that the "sql.h" is missing for pyodbc module.
I know from more searching that pyodbc isn't natively supported on linux, thereby how can I build my app with the pyodbc module ?

I have looked for answers online but still fail until now.
Your help will be much appreciated, thankss

Santosha Spickard

unread,
Mar 22, 2022, 1:32:31 PM3/22/22
to Kivy users support
Hi, if you follow the directions here it works. I did mess up my environment the first time so bad I just had to do it again from scratch and it worked.

Santosha Spickard

unread,
Mar 22, 2022, 1:47:00 PM3/22/22
to Kivy users support

Robert

unread,
Mar 22, 2022, 5:29:34 PM3/22/22
to Kivy users support
Yes, but I think the goal is pyodbc built for Android.

p4a builds packages for Android using a 'recipe', there isn't one for pyodbc https://github.com/kivy/python-for-android/tree/develop/pythonforandroid/recipes

Which means you have to create one. To do this you have to be self supporting based on the examples above and the instructions https://github.com/kivy/python-for-android/blob/develop/doc/source/recipes.rst

You will also need https://code.google.com/archive/p/pyodbc/wikis/Building.wiki
Note that Android uses Clang and not gcc, just more details to handle.

Santosha Spickard

unread,
Mar 23, 2022, 10:30:23 AM3/23/22
to Kivy users support
Yes, the instructions I have above simply get rid of the error for the missing sql.h. 
 As for the recipe for pyodbc, I am actualyl struggling through trying to get that setup for myself right now as I am getting the error below, but I am just about to give up and change my entire database backend because I can't seem to get this recipe thing to work....

ImportError: dlopen failed: "/data/data/org.provisionsarena.provisionsarenav001/files/app/_python_bundle/site-packages/pyodbc.so" is 64-bit instead of 32-bit

Robert

unread,
Mar 23, 2022, 1:18:58 PM3/23/22
to Kivy users support
That cryptic message usually occurs when some x86_64 whl is being included, rather than a recipe to build an arm .so.
The message is clearer if you appclean and build for arm8, when it will say x86_64 not arm8.
But a clear message does not address the issue that a recipe must be created to use this package.
Reply all
Reply to author
Forward
0 new messages