From: Barry D. <bl...@ad...> - 2004-08-09 17:22:23
|
Having a problem with the WX backend; details follow. I have wxPython 2.5 and matplotlib-0.60.2.win32-py2.3 installed. My code snippet: import matplotlib matplotlib.use("WXAgg") from matplotlib.matlab import * Error msg: Matplotlib backend_wx requires wxPython be installed Code snippet from: C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py try: from wxPython.wx import * except: print >>sys.stderr, "Matplotlib backend_wx requires wxPython be installed" sys.exit() I receive the following traceback when I try to invoke this from the command line: Enthought Edition build 1057 Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from wxPython.wx import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python23\lib\site-packages\wxPython\__init__.py", line 10, in ? import _wx File "C:\Python23\Lib\site-packages\wxPython\_wx.py", line 3, in ? from core import * File "C:\Python23\Lib\site-packages\wxPython\core.py", line 15, in ? import wx.core File "C:\Python23\lib\site-packages\wxPython\wx.py", line 4, in ? from misc import * File "C:\Python23\lib\site-packages\wxPython\misc.py", line 15, in ? import wx.misc File "C:\Python23\lib\site-packages\wxPython\wx.py", line 6, in ? from misc2 import * File "C:\Python23\lib\site-packages\wxPython\misc2.py", line 4, in ? from windows import * File "C:\Python23\lib\site-packages\wxPython\windows.py", line 15, in ? import wx.windows File "C:\Python23\lib\site-packages\wxPython\wx.py", line 10, in ? from gdi import * File "C:\Python23\lib\site-packages\wxPython\gdi.py", line 15, in ? import wx.gdi File "C:\Python23\lib\site-packages\wxPython\wx.py", line 12, in ? from fonts import * File "C:\Python23\lib\site-packages\wxPython\fonts.py", line 120, in ? class wxFontPtr(wxObjectPtr): NameError: name 'wxObjectPtr' is not defined code snippet from: C:\Python23\Lib\site-packages\wxPython\fonts.py class wxFontPtr(wxObjectPtr): This doesn't seem to be a problem specific to matplotlib. But, I'm wondering if anyone has already solved this or I'm just missing something. Thanks. Barry Drake |
From: Barry D. <bl...@ad...> - 2004-08-09 18:07:23
|
Update to my previous post: When I use the command line to use WXAgg, I receive the following traceback: >>> import matplotlib >>> matplotlib.use("WXAgg") >>> from matplotlib.matlab import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python23\Lib\site-packages\matplotlib\matlab.py", line 144, in ? from backends import new_figure_manager, error_msg, \ File "C:\Python23\Lib\site-packages\matplotlib\backends\__init__.py", line 39, in ? from backend_wxagg import \ File "C:\Python23\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 20, in ? from backend_wx import FigureManager File "C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py", line 116, in ? wxapp = wxPySimpleApp() NameError: name 'wxPySimpleApp' is not defined This means that it gets past the try-except in backend_wx.py, but can't find wxPySimpleApp. In the previous post, when runing the code from a file, the exception was caught and a sysexit() occurred. I don't understand why in one case the exception is caught and not in the other. In either case, I'm still unable to use the wx backend. Thanks. Barry Drake --- Barry Drake wrote: > Having a problem with the WX backend; details > follow. > > I have wxPython 2.5 and > matplotlib-0.60.2.win32-py2.3 > installed. > > My code snippet: > import matplotlib > matplotlib.use("WXAgg") > from matplotlib.matlab import * > > Error msg: > Matplotlib backend_wx requires wxPython be installed > > Code snippet from: > C:\Python23\Lib\site-packages\matplotlib\backends\backend_wx.py > try: > from wxPython.wx import * > except: > print >>sys.stderr, "Matplotlib backend_wx > requires wxPython be installed" > sys.exit() > > I receive the following traceback when I try to > invoke > this from the command line: > > Enthought Edition build 1057 > Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC > v.1200 > 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for > more information. > >>> from wxPython.wx import * > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "C:\Python23\lib\site-packages\wxPython\__init__.py", > line 10, in ? > import _wx > File > "C:\Python23\Lib\site-packages\wxPython\_wx.py", > line > 3, in ? > from core import * > File > "C:\Python23\Lib\site-packages\wxPython\core.py", > line > 15, in ? > import wx.core > File > "C:\Python23\lib\site-packages\wxPython\wx.py", > line 4, in ? > from misc import * > File > "C:\Python23\lib\site-packages\wxPython\misc.py", > line > 15, in ? > import wx.misc > File > "C:\Python23\lib\site-packages\wxPython\wx.py", > line 6, in ? > from misc2 import * > File > "C:\Python23\lib\site-packages\wxPython\misc2.py", > line 4, in ? > from windows import * > File > "C:\Python23\lib\site-packages\wxPython\windows.py", > line 15, in ? > import wx.windows > File > "C:\Python23\lib\site-packages\wxPython\wx.py", > line 10, in ? > from gdi import * > File > "C:\Python23\lib\site-packages\wxPython\gdi.py", > line > 15, in ? > import wx.gdi > File > "C:\Python23\lib\site-packages\wxPython\wx.py", > line 12, in ? > from fonts import * > File > "C:\Python23\lib\site-packages\wxPython\fonts.py", > line 120, in ? > class wxFontPtr(wxObjectPtr): > NameError: name 'wxObjectPtr' is not defined > > code snippet from: > C:\Python23\Lib\site-packages\wxPython\fonts.py > class wxFontPtr(wxObjectPtr): > > This doesn't seem to be a problem specific to > matplotlib. But, I'm wondering if anyone has > already solved this or I'm just missing something. > > Thanks. > Barry Drake > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you > noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the > past few weeks? Now, > one more big change to announce. We are now OSTG- > Open Source Technology > Group. Come see the changes on the new OSTG site. > www.ostg.com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: John H. <jdh...@ac...> - 2004-08-09 18:39:00
|
>>>>> "Barry" == Barry Drake <bl...@ad...> writes: Barry> This means that it gets past the try-except in Barry> backend_wx.py, but can't find wxPySimpleApp. Are you using the standard python shell or an IDE like pycrust? If the latter, it may be overriding the sys,exit which is why you aren't seeing it. From your previous post, it looks like your wx installation is in bad shape. Until you can do 'from wxPython.wx import *' from the standard python shell, I wouldn't bother with trying to tweak matplotlib. I didn't see any error message like the one you were getting in the wxpython archives - you might try the wx mailing list. JDH |
From: Barry D. <bl...@ad...> - 2004-08-09 20:24:58
|
John, I'm using a windows XP shell; so no extra stuff running. I did run all of the wxPython 2.5 demos before trying my old matplotlib code. The wxPython demos ran fine. My "old" matplotlib code ran under matplotlib 0.54.2 with wxPython 2.4.1.2; I tested all of the backends with success. After upgrading to wxPython 2.5 all of my matplotlib code is broken. I even upgraded to the latest matplotlib, 0.61. Still doesn't work. I'll try a clean reinstall next. If that doesn't work I'll go to the wx lists. Thanks. Barry --- John Hunter wrote: > >>>>> "Barry" == Barry Drake <> > writes: > > Barry> This means that it gets past the > try-except in > Barry> backend_wx.py, but can't find > wxPySimpleApp. > > Are you using the standard python shell or an IDE > like pycrust? If > the latter, it may be overriding the sys,exit which > is why you aren't > seeing it. From your previous post, it looks like > your wx > installation is in bad shape. Until you can do > 'from wxPython.wx > import *' from the standard python shell, I wouldn't > bother with > trying to tweak matplotlib. > > I didn't see any error message like the one you were > getting in the > wxpython archives - you might try the wx mailing > list. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you > noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the > past few weeks? Now, > one more big change to announce. We are now OSTG- > Open Source Technology > Group. Come see the changes on the new OSTG site. > www.ostg.com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Barry D. <bl...@ad...> - 2004-08-09 20:46:38
|
John, Clean install worked. Must have had some version leftovers around. Thanks. Barry --- John Hunter wrote: > >>>>> "Barry" == Barry Drake <> > writes: > > Barry> This means that it gets past the > try-except in > Barry> backend_wx.py, but can't find > wxPySimpleApp. > > Are you using the standard python shell or an IDE > like pycrust? If > the latter, it may be overriding the sys,exit which > is why you aren't > seeing it. From your previous post, it looks like > your wx > installation is in bad shape. Until you can do > 'from wxPython.wx > import *' from the standard python shell, I wouldn't > bother with > trying to tweak matplotlib. > > I didn't see any error message like the one you were > getting in the > wxpython archives - you might try the wx mailing > list. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you > noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the > past few weeks? Now, > one more big change to announce. We are now OSTG- > Open Source Technology > Group. Come see the changes on the new OSTG site. > www.ostg.com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |