From: Jim B. <jb...@se...> - 2004-05-06 04:35:12
|
Hi, I finally tried to upgrade from matplotlib-0.52 to 0.53.1. When i try to run my app that works fine on 0.52, it crashes when i try to make plot (the matplotlib part). floyd:/home/jbenson/python>python nrpapp.py Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_wx.py", line 990, in _onPaint self.draw() File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_wx.py", line 875, in draw self.figure.draw(renderer) File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py", line 88, in draw self._draw(renderer, *args, **kwargs) File "/usr/local/lib/python2.3/site-packages/matplotlib/figure.py", line 89, in _draw for a in self.axes: a.draw(renderer) File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py", line 88, in draw self._draw(renderer, *args, **kwargs) File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 561, in _draw self.xaxis.draw(renderer) File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py", line 88, in draw self._draw(renderer, *args, **kwargs) File "/usr/local/lib/python2.3/site-packages/matplotlib/axis.py", line 443, in _draw tick.draw(renderer) File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py", line 88, in draw self._draw(renderer, *args, **kwargs) File "/usr/local/lib/python2.3/site-packages/matplotlib/axis.py", line 119, in _draw if self.label1On: self.label1.draw(renderer) File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py", line 88, in draw self._draw(renderer, *args, **kwargs) File "/usr/local/lib/python2.3/site-packages/matplotlib/text.py", line 74, in _draw renderer.draw_text(gc, x, y, self) File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_wx.py", line 499, in draw_text font = self.get_wx_font(t) File "/usr/local/lib/python2.3/site-packages/matplotlib/backends/backend_wx.py", line 600, in get_wx_font self.fontweights[t.get_fontweight()], # Weight KeyError: 'medium' floyd:/home/jbenson/python> This may not be enough info for you to help me, but on the other hand you might immediately see something that i have wrong. ...err is there the equivalent of a 'make clean" in the "python setup.py install" (yup i'm a newbie to some aspects of python) ...i just tried a re-install of 0.52..and while it did stuff, clearly 0.53 is still being used. It's my home machine...so not a real big deal. I also tried: [root@floyd matplotlib-0.52]# python setup.py clean running clean [root@floyd matplotlib-0.52]# python setup.py install running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /usr/local/bin/postinstall.py to 755 running install_data [root@floyd matplotlib-0.52]# and [root@floyd matplotlib-0.53.1]# python setup.py clean running clean removing 'build/temp.linux-i686-2.3' (and everything under it) [root@floyd matplotlib-0.53.1]# and then: [root@floyd matplotlib-0.52]# python setup.py install running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /usr/local/bin/postinstall.py to 755 running install_data [root@floyd matplotlib-0.52]# I also tried moving the 0.52 dist to a back, untarring and then redoing the "python setup.py install" ...but still i'm stuck with my non-working upgrade. ok..so i went into floyd:/usr/local/lib/python2.3/site-packages> and moved the matplotlib dir to matplotlib.bak and then tried a re-install of 0.52...my app again words..whew! (is there an easier way to uninstall?) Thanks for any comments (including RT_Fine_M section xx), Jim |
From: Andrew S. <str...@as...> - 2004-05-06 05:43:09
|
Jim Benson wrote: > <>I finally tried to upgrade from matplotlib-0.52 to 0.53.1. > <>ok..so i went into floyd:/usr/local/lib/python2.3/site-packages> > and moved the matplotlib dir to matplotlib.bak and then tried > a re-install of 0.52...my app again words..whew! (is there an > easier way to uninstall?) The same trick should (hopefully) get 0.53.1 to work: get rid of the old matplotlib in site-packages before installing a new one. Probably some files from 0.52 are screwing up 0.53.1. (This is a limitation of Python's distutils -- upgrades should really wipe the package out of site-packages rather than adding files.) Cheers! Andrew |
From: Jim B. <jb...@se...> - 2004-05-06 06:05:22
|
On Wed, 5 May 2004, Andrew Straw wrote: > Jim Benson wrote: > > > <>I finally tried to upgrade from matplotlib-0.52 to 0.53.1. > > > <>ok..so i went into floyd:/usr/local/lib/python2.3/site-packages> > > and moved the matplotlib dir to matplotlib.bak and then tried > > a re-install of 0.52...my app again words..whew! (is there an > > easier way to uninstall?) > > The same trick should (hopefully) get 0.53.1 to work: get rid of the old > matplotlib in site-packages before installing a new one. Probably some > files from 0.52 are screwing up 0.53.1. > > (This is a limitation of Python's distutils -- upgrades should really > wipe the package out of site-packages rather than adding files.) > > Cheers! > Andrew > ...and also a limitation of my late night thinking. Your suggestion appears to have worked like a charm. I'll definitely use your advice for all future upgrades of any python packages. Thanks!! Jim |
From: John H. <jdh...@ac...> - 2004-05-06 12:23:08
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes: Andrew> The same trick should (hopefully) get 0.53.1 to work: get Andrew> rid of the old matplotlib in site-packages before Andrew> installing a new one. Probably some files from 0.52 are Andrew> screwing up 0.53.1. Andrew> (This is a limitation of Python's distutils -- upgrades Andrew> should really wipe the package out of site-packages rather Andrew> than adding files.) I did some testing by successively installing 0.53.1 and then my CVS tree comparing a file in site-packages/matplotlib that I knew had changed in the two versions. New files do indeed replace old files, but it appears only if their time stamps are newer. So if I install the 0.53.1 tree to a clean site-packages and then the CVS tree, the file (mathtext.py) is updated (both dirs have clean build directories). If I then go back the 0.53.1 and flush the build dir and reinstall, the *.so files are installed to site-packages (these are freshly built and so have new time stamps), but the *.py files are not, presumably because they are older than the ones in site-packages. I don't know why you encountered trouble Jim because you were upgrading in the right direction (screwy system clock, something about how and when you unarchived the different versions?) but this definitely explains why your attempt to downgrade failed. But Andrew is definitely right: when in doubt I do > sudo rm -rf /usr/local/lib/python2.3/site-packages/matplotlib > sudo rm -rf build before installing. I checked distutils and there does not seem to be any flag you can set to guarantee a clean install. JDH |