[MacPorts] #17691: py25-matplotlib 0.98.5 not working properly

MacPorts noreply at macports.org
Thu Dec 18 01:58:55 PST 2008


#17691: py25-matplotlib 0.98.5 not working properly
------------------------------------------+---------------------------------
 Reporter:  macsforever2000@…             |       Owner:  ram@…           
     Type:  defect                        |      Status:  assigned        
 Priority:  Normal                        |   Milestone:  Port Bugs       
Component:  ports                         |     Version:  1.7.0           
 Keywords:                                |        Port:  py25-matplotlib 
------------------------------------------+---------------------------------

Comment(by ram@…):

 Looking at this there are a couple of problems. If I run the command you
 state I get the error:

 {{{
 $ python
 /opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py
 /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
 /site-packages/pytz/__init__.py:32:
 UserWarning: Module dap was already imported from None, but
 /opt/local/lib/python2.5/site-packages is being added to sys.path
   from pkg_resources import resource_stream
 Traceback (most recent call last):
   File
 "/opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py",
 line 9, in <module>
     d1, p1, d2, p2 = get_two_stock_data()
   File
 "/opt/local/share/py25-matplotlib/examples/pylab_examples/data_helper.py",
 line 13, in get_two_stock_data
     M1 = fromstring( file('../data/%s.dat' % ticker1, 'rb').read(), '<d')
 IOError: [Errno 2] No such file or directory: '../data/INTC.dat'
 $
 }}}

 and looking at the source in the example, the path to the data file is
 relative so you need to change into the directory containing the example
 for it to be able to find the data. So if I now change into this directory
 and run the example:

 {{{
 $ cd /opt/local/share/py25-matplotlib/examples/pylab_examples
 $ python stock_demo.py
 /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
 /site-packages/pytz/__init__.py:32:
 UserWarning: Module dap was already imported from None, but
 /opt/local/lib/python2.5/site-packages is being added to sys.path
   from pkg_resources import resource_stream
 $
 }}}

 nothing happens, this is because the default backend is now Agg which is
 not an interactive backend, as I wanted to be able to support multiple
 interactive backends, and this example assumes an interactive backend. It
 does work however if you set the backend on the command line:

 {{{
 $ python stock_demo.py -dMacOSX
 }}}

 So there are a few options to solve this:
  1. Go back to only supporting a single backend
  1. Set the default backend to MacOSX, which is very new
  1. Put a post activate message stating that the default backend is Agg,
 and that another can be set by specifiying it in the
 `.matplotlib/matplotlibrc` file

 I think I would prefer the third option, to give users the most
 flexibility.

 Plus theres that `dap` warning I need to look into...

-- 
Ticket URL: <http://trac.macports.org/ticket/17691#comment:2>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list