Fix for OfflineImap not finding SQLite backend
Recently I've been running into an issue when using OfflineImap to get my email. It took me a while to track down a solution to this problem so I figured a quick post was in order for future reference for myself and others. Below is a description of the problem, how it came about after working fine initially and the solution found.
Problem encountered
Running offlineimap
produces the error SQLite backend chosen, but no sqlite
python bindings available. Please install.
for each account that uses
status_backend = sqlite
for its cache.
This caused some pretty inconsistent email fetches where sometimes it would work and retrieve email but often it would just fail.
Root of the cause
If you've run into this issue, you are most likely on OSX and using Homebrew as a package manager. A little while ago SQLite was made keg-only to fix other problems. If you had SQLite and Python installed before this point you most likely have run into the issue described above.
If you were to install SQLite or Python now, it will do all the association necessary to ensure the keg-only SQLite is used.
Solution!!
It's remarkably easy to fix this issue, it was just difficult to track down a solid answer. I managed to find a glint of hope in this issue referring to SQLite update breaking Python on GitHub.
All you have to do is uninstall SQLite and Python and re-install just Python.
Installing just Python will install the needed SQLite with all the needed associations in place.
If you're using Python3 for anything, be sure to include that as well
Hope this helps anyone else who has run into the same issue!