Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

KeyError when running self.mpl_modules_for_patching.pop(module) #1041

Closed
brettcannon opened this issue Nov 20, 2018 · 4 comments
Closed

KeyError when running self.mpl_modules_for_patching.pop(module) #1041

brettcannon opened this issue Nov 20, 2018 · 4 comments

Comments

@brettcannon
Copy link
Member

microsoft/vscode-python#2982

I'm guessing there's a race condition, in which case this probably just needs a try/except KeyError: pass block to avoid this issue.

@stefan--
Copy link

stefan-- commented Jan 4, 2019

please see microsoft/vscode-python#2982 (comment) for replication instructions.

@yzhang-gh
Copy link

Here I get one more warning before the error

WARNING: QApplication was not created in the main() thread.  <- **This line**
Backend Qt5Agg is interactive backend. Turning interactive mode on.
Traceback (most recent call last):

  ... (the same)

KeyError: 'matplotlib.pyplot'

@fabioz
Copy link
Contributor

fabioz commented Jan 24, 2019

Just provided a fix where the initialization/event loop will only take place in the main thread (processing the event loop out of the main thread is an error and this prevents the racing condition too).

@karthiknadig
Copy link
Member

Fixed via #1121

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants