I'm sending a little module I use to force a particular version of matplotlib and backend in my library.
This is imported in my package __init__.py to make sure the environment is sane. It can also be imported in the beginning of the app to set up a sane environment, which may be necessary if the app uses matplotlib outside my library.
I don't think there is anything we can do within matplotlib to address the version requirements.
The backend check could be a little easier if we modify matplotlib.use() to be silent if the backend is already in use, or raise an error if it isn't. ImportError seems appropriate, since use() is kind of like an import. Calling switch_backend() is another option.
config.py (1.88 KB)