# Want to update sqlite that came with python

**URL:** <https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056>\
**Category:** Python Help\
**Tags:** help\
**Created:** [January 11, 2022, 7:55pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056 "2022-01-11T19:55:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReverendJim](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ReverendJim](https://discuss.python.org/u/ReverendJim)\
**Post date:** [January 11, 2022, 7:55pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/1 "2022-01-11T19:55:03Z")

</div>

I’m currently running Python 3.8.2. I’m not updating again until a version of wxPython is released that will run under the newer version. The version of sqlite that comes with Python is 2.6.0 (used by **import sqlite3** ). I have tried several ways to update this to the 3.7.x version (or really, anything newer than 2.6.0) and everything leaves me at 2.6.0.

Running pip list doesn’t even show a sqlite package installed at all which is odd since I can do **import sqlite3** and use all the sqlite functionality.

Can anyone tell me how to update sqlite to a more recent version?

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [January 11, 2022, 8:02pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/2 "2022-01-11T20:02:16Z")

</div>

You’re checking the wrong version number 🙂

The `sqlite3` module was forked off of the `pysqlite` project back in 2005 or 2006 IIRC. The `version` attribute comes from the `pysqlite` version, not the SQLite library version. To see what version the underlying SQLite library has, check the `sqlite_version` attribute:

```auto
$ python3.8
Python 3.8.12 (default, Oct 13 2021, 06:42:42) 
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.37.0'
>>> sqlite3.sqlite_version_info # it is also available as a tuple
(3, 37, 0)

```

(As you might guess, my Python 3.8 is not the official Python 3.8 binary, given the very recent SQLite version number. IIRC, the official Python 3.8 binary comes with SQLite 3.35.5.)

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [January 11, 2022, 8:10pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/3 "2022-01-11T20:10:23Z")

</div>

For the record, pysqlite was fairly regularly updated on the outside of the CPython standard library. The most recent release is pysqlite 2.8.3 in 2016: [Tags · ghaering/pysqlite · GitHub](https://github.com/ghaering/pysqlite/tags)

---

<div class="post-metadata">

**Author:** ![ReverendJim](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ReverendJim](https://discuss.python.org/u/ReverendJim)\
**Post date:** [January 11, 2022, 8:20pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/4 "2022-01-11T20:20:01Z")

</div>

Aaaarrrggghhhh. As clear as anything else in this industry. And I should know. I’ve been in it since the 70s

Thanks for clearing that up.

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [January 11, 2022, 8:33pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/5 "2022-01-11T20:33:09Z")

</div>

Glad to help 🙂 Checking the docs, I see that it is actually documented as well:

[https://docs.python.org/3.8/library/sqlite3.html#sqlite3.sqlite\_version](https://docs.python.org/3.8/library/sqlite3.html#sqlite3.sqlite_version)

---

<div class="post-metadata">

**Author:** ![encukou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/encukou/32/2461_2.png) [@encukou](https://discuss.python.org/u/encukou)\
**Post date:** [January 12, 2022, 11:52am UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/6 "2022-01-12T11:52:41Z")

</div>

Looks like `sqlite3.version` is unnecessary and misleading. Would it make sense to deprecate it?

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [January 12, 2022, 1:32pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/7 "2022-01-12T13:32:49Z")

</div>

@storchaka brought this up on python-dev a while ago (generally, not especially the sqlite3 module):

[https://mail.python.org/archives/list/python-dev@python.org/thread/KBU4EU2JULXSMUZULD5HJJWCGOMN52MK/#6PUP4FORLNX4TAEET42C6YN4SGR22SSU](https://mail.python.org/archives/list/python-dev@python.org/thread/KBU4EU2JULXSMUZULD5HJJWCGOMN52MK/#6PUP4FORLNX4TAEET42C6YN4SGR22SSU)

**EDIT** : That thread was specifically about the ` __version__ ` dunder methods, not the plain `version` as seen in sqlite3. I see I was corrected in that thread 😆

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [January 12, 2022, 1:33pm UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/8 "2022-01-12T13:33:21Z")

</div>

I’d happily deprecate it now in 3.11 alpha.

---

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [May 31, 2022, 7:22am UTC](https://discuss.python.org/t/want-to-update-sqlite-that-came-with-python/13056/9 "2022-05-31T07:22:27Z")

</div>

Right… I’d also happily deprecate it in 3.12 alpha 😆 I’ll create an issue right away, so I don’t forget about it again.

**UPDATE** : I created [gh-93370](https://github.com/python/cpython/issues/93370)
