I've developed a website in Django (3.0.8) using the latest Python version (3.8.3). I'm working on a Unix server with Python 3.6.9 installed, which includes Sqlite version 3.7.17. Django apparently requires Sqlite 3.8 or higher.
So, I compiled a local copy of the latest Python following the guide here: https://www.a2hosting.com/kb/developer-corner/python/using-a-newer-version-of-python
I set up a virtual environment as described above and everything is working smoothly, except that Python is still using the old Sqlite version. After hours of work trying to figure all this out I'm stumped.
I can access Python and Sqlite3 via command line in standard environment:
-bash-4.2$ python --version
Python 3.6.9
-bash-4.2$ python
>>> import sqlite3, inspect
>>> sqlite3.sqlite_version
'3.7.17'
>>> inspect.getfile(sqlite3)
'opt/rh/rh-python36/root/usr/lib64/python3.6/sqlite3/__init__.py'
and in virtual environment:
-bash-4.2$ source bin/venv/bin/activate
(venv) -bash-4.2$ python --version
Python 3.8.3
-bash-4.2$ python
>>> import sqlite3, inspect
>>> sqlite3.sqlite_version
'3.7.17'
>>> inspect.getfile(sqlite3)
'users/.../lib/python3.8/sqlite3/__init__.py
So, despite running Python 3.8.3 and pointing to the correct library (as far as I can tell) in the virtual environment, the sqlite version is still the same as the standard environment. Any suggestions would be greatly appreciated!