That is a question for the team at GitHub - kubernetes-client/python: Official Python client library for kubernetes
The latest available lib version is v18.17 alpha and this supports only officially the Kubernetes v1.18
What i would do in your case is the following.
Create an empty site - install manually with pip3 the latest version of the Python lib.
Test from this empty site if you can query your Kubernetes.
Why to do this in an empty site? → You don’t want to mess up your Python libs in a production environment