Please try to get glxgears to run before attempting anything else that uses OpenGL. We can only provide limited support in debugging your platform issues.
A quick Google search for libGL error: failed to load driver: swrast turns up this thread:
How can i deal with 'libGL error: failed to load driver: swrast.' · Issue #509 · openai/gym · GitHub
which suggests installing the mesa-utils and libgl1-mesa-glx packages.
It also suggests testing by using the environment LIBGL_DEBUG:
LIBGL_DEBUG=verbose glxinfo