Skip to content
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

Switching backends in matplotlib 3.3.0 fails #1792

Closed
umesh-timalsina opened this issue Jul 22, 2020 · 2 comments
Closed

Switching backends in matplotlib 3.3.0 fails #1792

umesh-timalsina opened this issue Jul 22, 2020 · 2 comments
Labels
bug job feedback Graphs, images, and other feedback generated during job execution.

Comments

@umesh-timalsina
Copy link
Contributor

With exporting custom backend in matplotlib 3.3.0

src/plugins/GenerateJob/templates$  export MPLBACKEND=module://backend_deepforge
Python 3.7.6 | packaged by conda-forge | (default, Jun  1 2020, 18:57:50) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'3.3.0'
>>> from matplotlib import pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/umesh/anaconda3/envs/deepforge/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2319, in <module>
    switch_backend(rcParams["backend"])
  File "/home/umesh/anaconda3/envs/deepforge/lib/python3.7/site-packages/matplotlib/pyplot.py", line 283, in switch_backend
    matplotlib.backends.backend = newbackend
AttributeError: module 'matplotlib' has no attribute 'backends'
>>> 

When used with a pipeline execution:
image

@umesh-timalsina umesh-timalsina added bug job feedback Graphs, images, and other feedback generated during job execution. labels Jul 22, 2020
@umesh-timalsina
Copy link
Contributor Author

For now we should pin matplotlib==3.2.2, which will be helpful in resolving #1747 (comment) as well.

@brollb
Copy link
Contributor

brollb commented Jul 22, 2020

Pinning matplotlib to 3.2.2 is a good idea.

It looks like the bug is actually in matplotlib - our code is simply importing pyplot and it is failing. (It's hard to argue that the error is on our side when we aren't able to get past the import!) It might be worth seeing if anyone else has encountered this issue on the latest version of matplotlib but I wouldn't put it as a high priority since 3.2.2 should work just fine for now.

@brollb brollb closed this as completed in 0b07e0d Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug job feedback Graphs, images, and other feedback generated during job execution.
Projects
None yet
Development

No branches or pull requests

2 participants