matplotlib on remote host Mac OS/X

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

Davide Lazzati wrote:

  Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks
  
Davide: This will only work if you use an X11-based backend (like GTK Agg), since only X11 is forwarded over SSH. If you're using a mac-native backend, the window is popping up on your mac's screen when you do show().

-Jeff

Hi,

I think your situation is different from mine, but just thought it might help.

I have a server running linux and I use mac pro to connect to the
server and export graphics from the linux server. I could get my mac
pro to display the graphics from the linux server only after I start
X11 on my mac pro and then use ssh -X to connect to the linux server.

Wonder if you also have to do something like that when you connect.
First, start X11 on your mac and then connect to your other mac (linux
in my case though).

Cheers,
Chaitanya.

···

On Tue, Feb 17, 2009 at 2:01 AM, Davide Lazzati <dlazzati@...287...> wrote:

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I've tried to use GTKAgg and it gives me an error message . I'm now
running on the MacOSX backend and the graphic window appears on the
remote screen (where pyton is running) rather than on the local one
(in front of which I am sitting). Any idea on how to open the graphic
window with a MacOSX or TkAgg backends on the local screen while
python is running remote?

Thanks again
Davide

···

On Mon, Feb 16, 2009 at 8:13 PM, Jeff Whitaker <jswhit@...146...> wrote:

Davide Lazzati wrote:

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

Davide: This will only work if you use an X11-based backend (like GTK Agg),
since only X11 is forwarded over SSH. If you're using a mac-native backend,
the window is popping up on your mac's screen when you do show().

-Jeff

--

Davide Lazzati, Assistant Professor
NCSU, Dept. of Physics, Riddick Hall
Office 400E, tel (919) 513 0926
Raleigh, NC, 27695-8202

Davide Lazzati wrote:

  

Davide Lazzati wrote:
    

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

Davide: This will only work if you use an X11-based backend (like GTK Agg),
since only X11 is forwarded over SSH. If you're using a mac-native backend,
the window is popping up on your mac's screen when you do show().

-Jeff
    
I've tried to use GTKAgg and it gives me an error message . I'm now
running on the MacOSX backend and the graphic window appears on the
remote screen (where pyton is running) rather than on the local one
(in front of which I am sitting). Any idea on how to open the graphic
window with a MacOSX or TkAgg backends on the local screen while
python is running remote?

Thanks again
Davide

Davide: As I said before, you have to use a backend compiled with X11 support if you want to ssh to run matplotlib remotely. You probably don't have one, since TkAgg is native OS X and you probably don't have the pre-requisites installed to build the GTKAgg backend. You have two choices:

1) install all the pre-requisites for the GTKAgg backend (don't know what they are offhand, but they include at least gtk2, glib and pygtk2). Package management systems like fink or macports can help with this.

2) use the screen-sharing feature of Leopard to remote control your mac instead of ssh. Then you will see exactly what is on the screen of the remote mac. This will work with any backend, but may be slow and/or complicated if you have firewalls in between the macs.

I do this routinely by using the python, pygtk2 and matplotlib packages installed by macports, Never had much luck with remote screen sharing because of firewall issues.

-Jeff

···

On Mon, Feb 16, 2009 at 8:13 PM, Jeff Whitaker <jswhit@...146...> wrote:

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

I installed atk, gtk2, pango, and cairo from macports. Then I
installed pygobject-2.16.0, pycairo-1.8.2, and pygtk-2.12.1 from the
sources.

All the installations seemed smooth.

However, when I import pylab using GTKAgg as a backend, ipython tells
me that there is not pygtk (see below for the whole error message).

Any insight?

Davide

···

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/Users/dlazzat/<ipython console> in <module>()

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/pylab.py
in <module>()
----> 1 from matplotlib.pylab import *
      2 import matplotlib.pylab
      3 __doc__ = matplotlib.pylab.__doc__

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/pylab.py
in <module>()
    251
    252
--> 253 from matplotlib.pyplot import *
    254
    255 # provide the recommended module abbrevs in the pylab namespace

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/pyplot.py
in <module>()
     73
     74 from matplotlib.backends import pylab_setup
---> 75 new_figure_manager, draw_if_interactive, show = pylab_setup()
     76
     77

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/__init__.pyc
in pylab_setup()
     23 backend_name = 'matplotlib.backends.%s'%backend_name.lower()
     24 backend_mod = __import__(backend_name,
---> 25 globals(),locals(),[backend_name])
     26
     27 # Things we pull in from all backends

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_gtkagg.py
in <module>()
      8 from matplotlib.figure import Figure
      9 from matplotlib.backends.backend_agg import FigureCanvasAgg
---> 10 from matplotlib.backends.backend_gtk import gtk,
FigureManagerGTK, FigureCanvasGTK,\
     11 show, draw_if_interactive,\
     12 error_msg_gtk, NavigationToolbar, PIXELS_PER_INCH,
backend_version, \

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_gtk.py
in <module>()
      9 import pango
     10 except ImportError:
---> 11 raise ImportError("Gtk* backend requires pygtk to be installed.")
     12
     13 pygtk_version_required = (2,2,0)

ImportError: Gtk* backend requires pygtk to be installed.

On Tue, Feb 17, 2009 at 1:11 PM, Jeff Whitaker <jswhit@...146...> wrote:

Davide Lazzati wrote:

On Mon, Feb 16, 2009 at 8:13 PM, Jeff Whitaker <jswhit@...146...> wrote:

Davide Lazzati wrote:

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

Davide: This will only work if you use an X11-based backend (like GTK
Agg),
since only X11 is forwarded over SSH. If you're using a mac-native
backend,
the window is popping up on your mac's screen when you do show().

-Jeff

I've tried to use GTKAgg and it gives me an error message . I'm now
running on the MacOSX backend and the graphic window appears on the
remote screen (where pyton is running) rather than on the local one
(in front of which I am sitting). Any idea on how to open the graphic
window with a MacOSX or TkAgg backends on the local screen while
python is running remote?

Thanks again
Davide

Davide: As I said before, you have to use a backend compiled with X11
support if you want to ssh to run matplotlib remotely. You probably don't
have one, since TkAgg is native OS X and you probably don't have the
pre-requisites installed to build the GTKAgg backend. You have two choices:

1) install all the pre-requisites for the GTKAgg backend (don't know what
they are offhand, but they include at least gtk2, glib and pygtk2). Package
management systems like fink or macports can help with this.

2) use the screen-sharing feature of Leopard to remote control your mac
instead of ssh. Then you will see exactly what is on the screen of the
remote mac. This will work with any backend, but may be slow and/or
complicated if you have firewalls in between the macs.

I do this routinely by using the python, pygtk2 and matplotlib packages
installed by macports, Never had much luck with remote screen sharing
because of firewall issues.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

Davide Lazzati wrote:

I installed atk, gtk2, pango, and cairo from macports. Then I
installed pygobject-2.16.0, pycairo-1.8.2, and pygtk-2.12.1 from the
sources.

All the installations seemed smooth.

However, when I import pylab using GTKAgg as a backend, ipython tells
me that there is not pygtk (see below for the whole error message).

Any insight?

Davide
  
Davide: You installed pygtk into macports python - so you have to use macports python to import it.

-Jeff

···

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/Users/dlazzat/<ipython console> in <module>()

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/pylab.py
in <module>()
----> 1 from matplotlib.pylab import *
      2 import matplotlib.pylab
      3 __doc__ = matplotlib.pylab.__doc__

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/pylab.py
in <module>()
    251
    252
--> 253 from matplotlib.pyplot import *
    254
    255 # provide the recommended module abbrevs in the pylab namespace

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/pyplot.py
in <module>()
     73
     74 from matplotlib.backends import pylab_setup
---> 75 new_figure_manager, draw_if_interactive, show = pylab_setup()
     76
     77

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/__init__.pyc
in pylab_setup()
     23 backend_name = 'matplotlib.backends.%s'%backend_name.lower()
     24 backend_mod = __import__(backend_name,
---> 25 globals(),locals(),[backend_name])
     26
     27 # Things we pull in from all backends

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_gtkagg.py
in <module>()
      8 from matplotlib.figure import Figure
      9 from matplotlib.backends.backend_agg import FigureCanvasAgg
---> 10 from matplotlib.backends.backend_gtk import gtk,
FigureManagerGTK, FigureCanvasGTK,\
     11 show, draw_if_interactive,\
     12 error_msg_gtk, NavigationToolbar, PIXELS_PER_INCH,
backend_version, \

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_gtk.py
in <module>()
      9 import pango
     10 except ImportError:
---> 11 raise ImportError("Gtk* backend requires pygtk to be installed.")
     12
     13 pygtk_version_required = (2,2,0)

ImportError: Gtk* backend requires pygtk to be installed.

On Tue, Feb 17, 2009 at 1:11 PM, Jeff Whitaker <jswhit@...146...> wrote:
  

Davide Lazzati wrote:
    

On Mon, Feb 16, 2009 at 8:13 PM, Jeff Whitaker <jswhit@...146...> wrote:

Davide Lazzati wrote:

Hi,

I'm trying to rum python and matlpotlib on a remote mac host from my
mac laptop. Both have Mac OS/X 10.5.6 and I'm using ssh -Y ...

However, the graphic window does not appear and, when I run p.show()
everything gets stuck.

Any insight?

Thanks

Davide: This will only work if you use an X11-based backend (like GTK
Agg),
since only X11 is forwarded over SSH. If you're using a mac-native
backend,
the window is popping up on your mac's screen when you do show().

-Jeff

I've tried to use GTKAgg and it gives me an error message . I'm now
running on the MacOSX backend and the graphic window appears on the
remote screen (where pyton is running) rather than on the local one
(in front of which I am sitting). Any idea on how to open the graphic
window with a MacOSX or TkAgg backends on the local screen while
python is running remote?

Thanks again
Davide

Davide: As I said before, you have to use a backend compiled with X11
support if you want to ssh to run matplotlib remotely. You probably don't
have one, since TkAgg is native OS X and you probably don't have the
pre-requisites installed to build the GTKAgg backend. You have two choices:

1) install all the pre-requisites for the GTKAgg backend (don't know what
they are offhand, but they include at least gtk2, glib and pygtk2). Package
management systems like fink or macports can help with this.

2) use the screen-sharing feature of Leopard to remote control your mac
instead of ssh. Then you will see exactly what is on the screen of the
remote mac. This will work with any backend, but may be slow and/or
complicated if you have firewalls in between the macs.

I do this routinely by using the python, pygtk2 and matplotlib packages
installed by macports, Never had much luck with remote screen sharing
because of firewall issues.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory