-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make matplotlib fail more gracefully in headless environments #6739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is to some degree a configuration/packaging issue. On servers that are known to be headless, the system wide configuration file should be set to Agg as the default backend. A way to do this is to require something on the backend be queryable if there are sufficient run-time requirements (which also makes sense for the GUI backends more generally as we do not know until we try if the python wrappers for the backend are even installed). This should probably be done in |
One place where this is not a configuration/packaging issue (at least, not On Thu, Jul 14, 2016 at 3:47 PM, Thomas A Caswell notifications@github.com
|
As and avid user, I just want to say a built-in fallback should be in place here. +1 So far I'm using this in my scripts:
Is there a better workaround? |
#8613 (comment) would also solve the issue: one would just need to put Agg at the end of the list of backends, rather than having even more specific fallback code. |
Closed by #9795 + following PRs. |
This is reproducible on any headless environment using matplotlib 1.5.1. On my system, the following script:
Will produce the following traceback:
I think it would be much nicer if backends somehow detected these sorts of errors, fell back to the Agg backend (probably with a warning) and then goes ahead and makes the plot.
The text was updated successfully, but these errors were encountered: