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

MatplotlibAttributeError: module 'sip' has no attribute 'setapi' #8545

Closed
sentry-io bot opened this issue Apr 26, 2021 · 8 comments · Fixed by #8558
Closed

MatplotlibAttributeError: module 'sip' has no attribute 'setapi' #8545

sentry-io bot opened this issue Apr 26, 2021 · 8 comments · Fixed by #8558
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework tool:sentry type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:dependencies Pull requests that update a dependency file

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 26, 2021

Sentry Issue: RASA-OPEN-SOURCE-8TT

AttributeError: module 'sip' has no attribute 'setapi'
(26 additional frame(s) were not displayed)
...
  File "rasa\core\policies\rule_policy.py", line 50, in <module>
    import rasa.core.test
  File "rasa\core\test.py", line 10, in <module>
    from rasa.nlu.test import EntityEvaluationResult, evaluate_entities
  File "rasa\nlu\test.py", line 24, in <module>
    import rasa.utils.plotting as plot_utils
  File "rasa\utils\plotting.py", line 43, in <module>
    _fix_matplotlib_backend()
  File "rasa\utils\plotting.py", line 20, in _fix_matplotlib_backend
    if matplotlib.get_backend() == "TkAgg":

Additional Information

@wochinge wochinge added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:dependencies Pull requests that update a dependency file area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Apr 26, 2021
@wochinge
Copy link
Contributor

wochinge commented Apr 26, 2021

@TyDunn Not super high prio (not that many users impacted by it so far), but I'd prioritize it slightly higher as there seems to be a compatibility problem

@m-vdb m-vdb self-assigned this Apr 26, 2021
@m-vdb
Copy link
Collaborator

m-vdb commented Apr 27, 2021

Other occurrences of this issue with Rasa:

Couldn't reproduce on Windows 10, python 3.7, using pyqt4 or pyqt5. I think it's really weird config on the user end, using an incompatible version of pyqt with matplotlib, and matplotlib fails to explain that to the user 🤔

There's this recent open issue on matplotlib's end: matplotlib/matplotlib#20040 but it's not helping so far. I'm tempted to either:

  • do nothing and ignore the issue in Sentry (after all, we closed the ticket because we flagged it as a usage issue)
  • try/except/re-raise here to explain that it's a matplotlib version issue (but TBH I don't know what this changes)

@m-vdb
Copy link
Collaborator

m-vdb commented Apr 27, 2021

one thing we can do to mitigate this issue is to not run _fix_matplotlib_backend() at module import time, but when matplotlib is actually needed 🤔

@wochinge
Copy link
Contributor

I think we closed #7144 when we went through all the issues so I don't recall it at all.
If it's such a weird config -> why are 35 users (and from the the OSs / Python versions they look differently) running into it and only on 2.5?

I also found a post which suggests an incompatibility with ipython.

Seems ignoring is the best option. The only other option I can think of is - in case maptlotlib 3.4 fixes this - excluding 3.2 from the dependency range.

@m-vdb
Copy link
Collaborator

m-vdb commented Apr 27, 2021

in case maptlotlib 3.4 fixes this

yes but we can't test it because I can't repro. I think that we can:

  • move the function in a decorator to not execute it at import time. That way users with falsy configs will not be blocked until they actually need to plot stuff (some stacktraces come from rasa init)
  • consider upgrading to matplotlib 3.4 (I haven't looked into that) without excluding 3.2 just yet
  • check when this comes up again, if we're able to reproduce it (I wouldn't rely on sentry but on a question for the forum for that purpose)

@m-vdb
Copy link
Collaborator

m-vdb commented Apr 27, 2021

aaaand it's not possible with the current python version we're supporting:

fact: matplotlib (3.4.1) requires Python >=3.7

kind of reminds me that this is something we should consider for 3.0

@wochinge
Copy link
Contributor

Will have a look at the PR right away.
it's actually helpful that matplotlib stops supporting 3.6 😁 Then it's not the new architecture's fault that we have to drop 3.6 but the ecosystem 🤷🏻

@m-vdb
Copy link
Collaborator

m-vdb commented Apr 28, 2021

also the fact that 3.6 end of life is 2021 😄

@m-vdb m-vdb closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework tool:sentry type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. type:dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants