On 8/6/2013 3:31 PM, Eric Firing [via matplotlib] wrote:
> Before the *first* import of pyplot, you need to have:
>
> import matplotlib
> matplotlib.use("agg")
>
> or specify any other non-interactive backend.  Alternatively, you can
> specify the backend in a matplotlibrc file.
>
> This assumes you don't actually need an interactive backend.  If you do
> need it, then I suspect you will need to change the strategy you are
> using in your program, ideally eliminating the input thread.  You might
> use a gtk idle event callback to handle the user input, for example.
> The problem here is that python threads and gui toolkits tend not to mix
> well.
>
> I suspect that raw_input is using the PyOS_InputHook, which is also
> being used by gtk, so you are violating the prohibition against
> gui-related activities being in more than one thread.
>
> Eric

Thanks Eric, that did work for me.  I don't necessarily need an 
interactive backend for this, but it could be nice to get it to work.  I 
just tried switching raw_input to sys.stdin.readline, and that seems to 
work even with the interactive backend.

John




--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Importing-pyplot-blocks-input-thread-tp41731p41733.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to