PyPlot problems, no GUI backend for matplotlib

1,633 views
Skip to first unread message

Stelios Georgiou

unread,
Aug 25, 2014, 12:03:13 AM8/25/14
to julia...@googlegroups.com
Hello, 

I can't get PyPlot to work in julia or IJulia notebook, this is the error I get. When I test matplotlib also I get no visuals. I can save images and view them after but cannot see live figures. Do you have any ideas? 

( I use homebrew python, with packages installed with pip ) 
( Julia is installed from standalone .dmg installer )  
( Using OS X 10.9 )

julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
INFO: Loading help data...


ipython
(2.2.0)

matplotlib (1.3.1)

Viral Shah

unread,
Aug 25, 2014, 8:11:21 AM8/25/14
to julia...@googlegroups.com
I get the same error. I think there is an old open issue on the topic in the IJulia repository.

-viral

Stelios Georgiou

unread,
Aug 25, 2014, 10:37:51 AM8/25/14
to julia...@googlegroups.com
Ok I fixed it, I didn't have qt installed, so I installed pyqt, did Pkg.build("PyPlot"). That worked

ron...@gmail.com

unread,
Aug 27, 2014, 9:06:00 PM8/27/14
to julia...@googlegroups.com
I'm having a similar problem.

Here's what used to work in IJulia Notebook, but now doesn't:

using PyPlot
plot([0 1])

which results in the following error message:

============================
PyError (PyObject_Call) <type 'exceptions.TypeError'>
TypeError('Julia exception: TypeError(:draw_if_interactive,"if",Bool,0)',)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 3086, in plot
    ax = gca()
  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 827, in gca
    ax =  gcf().gca(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 461, in gcf
    return figure()
  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 450, in figure
    draw_if_interactive()

while loading In[2], in expression starting on line 1 in pyerr_check at /Users/ubi/.julia/v0.3/PyCall/src/exception.jl:58 in pycall at /Users/ubi/.julia/v0.3/PyCall/src/PyCall.jl:85 in plot at /Users/ubi/.julia/v0.3/PyPlot/src/PyPlot.jl:290
============================

Perhaps foolishly, I've upgraded to julia v3.0, ijulia (i.e. ipython) v2.2, and python v2.7.8.

Any suggestions?

Ron Ueberschaer

unread,
Aug 27, 2014, 10:57:13 PM8/27/14
to julia...@googlegroups.com
Oops,

I meant

> julia v0.3

Steven G. Johnson

unread,
Aug 28, 2014, 6:34:07 AM8/28/14
to julia...@googlegroups.com


On Wednesday, August 27, 2014 9:06:00 PM UTC-4, ron...@gmail.com wrote:
I'm having a similar problem.

Here's what used to work in IJulia Notebook, but now doesn't:
[...]

 
The problem is that PyPlot doesn't currently work with Matplotlib 1.4; see

https://github.com/stevengj/PyPlot.jl/issues/79

Hopefully I'll be able to fix this soon, but for now you probably need to use Matplotlib 1.3.

ron...@gmail.com

unread,
Aug 28, 2014, 11:46:58 AM8/28/14
to julia...@googlegroups.com
Thanks, Steven. I thought I was crazy.

You suggested I

 use Matplotlib 1.3.

Forgive my ignorance, but I don't know how to revert versions.  I think I got it working originally and updated using pip.  So I did a

pip uninstall matplotlib

then tried variations of

pip install matplotlib-1.3

which all result in the error message

Could not find any downloads that satisfy the requirement matplotlib-1.3


Any suggestions?

Ron Ueberschaer

unread,
Aug 28, 2014, 12:01:35 PM8/28/14
to julia...@googlegroups.com
Nevermind,

I figured it out: use ‘==‘ to specify a version.

pip install matplotlib==1.3.1

works, and my IJulia Notebook is showing plots and images again.

All is good,

Ron Ueberschaer


Steven G. Johnson

unread,
Sep 3, 2014, 5:33:24 PM9/3/14
to julia...@googlegroups.com
On Thursday, August 28, 2014 6:34:07 AM UTC-4, Steven G. Johnson wrote:
The problem is that PyPlot doesn't currently work with Matplotlib 1.4; see

https://github.com/stevengj/PyPlot.jl/issues/79

Hopefully I'll be able to fix this soon, but for now you probably need to use Matplotlib 1.3.

This should be fixed now; Matplotlib 1.4 works for me.

(It turns out that Matplotlib 1.4 was helpfully refusing to enable interactive mode unless a Python interactive prompt was detected.)
Reply all
Reply to author
Forward
0 new messages