[MacPorts] #17691: py25-matplotlib 0.98.5 not working properly
#17691: py25-matplotlib 0.98.5 not working properly ------------------------------------------+--------------------------------- Reporter: macsforever2000@… | Owner: ram@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: | Port: py25-matplotlib ------------------------------------------+--------------------------------- The update of py25-matplotlib to 0.98.5 in r43887 is no longer working for me. Specifically, I have installed with the +wxpython variant. But I also tried with the default +tkinter variant. To verify this, run the following example that is installed with the port. {{{ python /opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py }}} This does not work in the current port - the plot simply does not appear. But when I reverted back to before r43887, it runs fine. I tried a number of other examples too including simple_plot.py and stem_plot.py. When it works (0.98.3 version of the portfile), it launches a "Python" application, but when it does not work (the current 0.98.5 version of the portfile), no "Python" application appears. -- Ticket URL: <http://trac.macports.org/ticket/17691> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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 ------------------------------------------+--------------------------------- Changes (by ram@…): * status: new => assigned -- Ticket URL: <http://trac.macports.org/ticket/17691#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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
#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 py25-dap ------------------------------------------+--------------------------------- Changes (by macsforever2000@…): * port: py25-matplotlib => py25-matplotlib py25-dap Comment: Replying to [comment:2 ram@…]:
3. 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 added a matplotlibrc file and set the backend to MacOSX and it works really well. Thanks! Keeping all the backends and adding a post activate message makes the most sense to me. One odd thing is that the resulting "Python" application that runs does not have a menu. So to quit it, you have to close the window. When using the WXAgg backend, the menu exists with a Quit item (as before).
Plus theres that `dap` warning I need to look into...
This no longer appears for me with your update of py25-dap. -- Ticket URL: <http://trac.macports.org/ticket/17691#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17691: py25-matplotlib 0.98.5 not working properly -------------------------------------------+-------------------------------- Reporter: macsforever2000@… | Owner: ram@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Resolution: fixed | Keywords: Port: py25-matplotlib py25-dap | -------------------------------------------+-------------------------------- Changes (by ram@…): * status: assigned => closed * resolution: => fixed Comment: Replying to [comment:3 macsforever2000@…]:
Keeping all the backends and adding a post activate message makes the most sense to me.
done in r43970
One odd thing is that the resulting "Python" application that runs does not have a menu. So to quit it, you have to close the window. When using the WXAgg backend, the menu exists with a Quit item (as before).
I see the same, I'll ask upstream
This no longer appears for me with your update of py25-dap.
I'm in the process of checking with upstream to see if that 'fix' is appropriate. -- Ticket URL: <http://trac.macports.org/ticket/17691#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts