question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

apk with sqlite3 python3 kivy No module named '_sqlite3'

See original GitHub issue

Ran into problems with making an APK, mostly due to incorrect software and api versions. The last of those (unable to find a valid dependency graph) was solved over in https://github.com/kivy/python-for-android/issues/1222

Now my APK compiles fine: and crashes on load. The problem is it can’t find the _sqlite3 module. The latest pythonforandroid has a recipe for sqlite3 which seems to compile just fine. It produces a libsqlite3.so file which is included in my APK (checked), but this doesn’t seem to be what python is looking for when the app loads on the device. I am able to run the rest of the app if I remove the import and use of the sqlite3 module, but it is critical to most of the functionality in the final version that sqlite3 work.

I have tried removing from blacklist.txt (wherever I could find one, there were several) any mention of sqlite3 files: no change. I have tried whitelisting sqlite3 files in buildozer.spec: no change. I have tried completely removing the .buildozer directory and allowing it all to re-downlooad/install/compile: no change. Love some help if anyone has ideas.

Edit: Just found in MyProject/.buildozer/android/platform/build/build/other_builds/python3/armeabi-v71__ndk_target_21/python3/android_build/config.log a mention of sqlite3 that looks like:

configure:10267: checking for --enable-loadable-sqlite-extensions
configure:10277: result: no

Does this mean sqlite is not being built into python3? Not sure how I would change this as buildozer is doing all the p4a stuff for me.

Edit 2: Further research tells me that option is not required to get sqlite3 working.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 11, 2019

Note: to use sqlite put “sqlite3” into --requirements and it needs to go before “python3” in your requirements list (otherwise the core module for it won’t be built)

0reactions
inclementcommented, Jan 30, 2019

Closing as hopefully fixed by #1617, please feel free to reopen if it does still happen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named _sqlite3 - python - Stack Overflow
It looks like you built and installed Python manually (are the packages in your OS too old?), since it's in /usr/local. Make sure...
Read more >
ModuleNotFoundError when building pysqlcipher3 with recipe
The app compiles into an .apk but when installed on an Android phone, it crashes saying ModuleNotFoundError: No module named 'pysqlcipher3'.
Read more >
buildozer 0.36 - PyPI
Buildozer APK not working: OS X, Docker, or fresh Ubuntu 16.04 ... No module named sqlite3 [\#56](https://github.com/kivy/buildozer/issues/56)
Read more >
[Fixed]-I'm getting a error in Google App Engine to do with import ...
ImportError: No module named _sqlite3 from _sqlite3 import * from dbapi2 import * import sqlite3. It has something to do with: import sqlite3....
Read more >
Q&A Discussions | Sololearn: Learn to code for FREE!
How do I store a apk file in a sqlite3 database in python. python3 ... Am trying to use sqlite3 and python but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found