I rebuild Hub docker image based on amazon linux2. When I tried to run it locally, I got error:
For the sqlite version error: sqlalchemy.exc.NotSupportedError: (sqlite3.NotSupportedError) deterministic=True requires SQLite 3.8.3 or higher
The default SQLite coming with amazon linux2 is 3.7.17. However, I have upgrade it to the latest version (3.40.x). I have deleted old sqlite from /usr/bin and create symbol link to /usr/local/bin (where the new version is installed). However, I still get above error.
I don’t know from where the JupyterHub picks up the SQLite version? And how to fix?
This is much more a question about linux distribution and packaging than it is z2jh.
In the other discussion you said you had a policy to use Amazon Linux. My first question is could you use Amazon Linux 2022 that’s based off Fedora rather than the very dated Centos 7
In your Dockerfile use
FROM amazonlinux:2022
Doing the below shows the much more modern python and sqlite which should make things easier
In response to your original question, there is a difference between sqlite binary and a library - the python sqlite bindings are compiled against the system sqlite when python is built (ie at rpmbuild). Thus your python doesn’t use /usr/bin/sqlite3 but the library as can be seen via ldd of the _sqlite3 module.
To get a working python with newer sqlite3 you will need to do the work to build/install or package yourself. You probably don’t want to replace the sqlite as that’ll break the OS image, so would need to install in a different location (or prefix) and build python for that
There are many ways of managing your OS python to support more recent versions, such as building your own RPMS using an alternate prefix (eg /opt or /usr/local), using a python version management tool such a pyenv, or other tools.
Like your previous question, this far exceeds what the Jupyter community can support - z2jh provides containers that are known to work, if you need to build your own due to policies there is only limited support that can be given.