Question: I need to use sqlite version 3.8 or higher with python in Amazon Linux. 

I updated my sqlite installation to the latest version:

```
$ sqlite3 -version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2171d

```

I also updated my pysqlite version

```
pip install --upgrade pysqlite

```

However, my pysqlite still only seems to support sqlite version 3.7:

```
$ python
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.7.17'
>>>
>>> from pysqlite2 import dbapi2 as sqlite
>>> sqlite.version
'2.8.3'
>>> sqlite.sqlite_version
'3.7.17'

```

How can I update the sqlite python API to support a newer version of sqlite?

Answer: 
**Option 1:** Use the binary version of pysqlite3 from here (which already comes with a newer version of sqlite3 lib precompiled and linked):
<https://github.com/coleifer/pysqlite3>.
Basically install with

```
pip install pysqlite3-binary

```

and in python code, use pysqlite3 instead of sqlite3 like:

```py
import pysqlite3
    (...) conn = pysqlite3.connect(r"filename")

```

**Alternative:**
Reinstall python, when installing python, a built in python's module sqlite3 (for working with sqlite) is compiling and uses (compiles) its own version of sqlite3 lib regardless of what you currently have in your system (this is the case at least on windows and mac systems, may be also the case for unix based systems).
There's unofficial Python wheel distribution of [APSW](https://github.com/rogerbinns/apsw) which itself [doesn't release on PyPI](https://rogerbinns.github.io/apsw/download.html#easy-install-pip-pypi):

> 
> APSW is not available at the Python Package Index (pypi) and hence cannot be installed from it. (A random person has put an outdated poor quality upload under the APSW name. It has nothing useful to do with this project.) The reason for this is [...]
> 
> 
> 

And I assume the reason predates Python wheels.

The wheel distribution package is called [apsw-wheels](https://pypi.org/project/apsw-wheels/) (and [GitHub repo](https://github.com/calebj/apsw-wheels)). It worked just fine for me except for PyPy wheels.