From: Michael R. <MRe...@be...> - 2004-10-01 00:16:13
|
Kevin, I apologize for the delay on this one... Your pointers helped me fix the problem.=20 When I ran: >>> from PythonCard.components import floatcanvas I received some additional information indicating that floatcanvas could = not import numarray, and thus would not load. Once I made numarray available, = *POOF* all the=20 symtoms I previously saw went away. Thanks for the help, Michael >>> "Kevin Altis" <al...@se...> 9/28/2004 11:03:12 AM >>> On Sep 28, 2004, at 8:50 AM, Michael Redmond wrote: > I have checked out PythonCard 0.8.1 from CVS, and I consistently get =20 > the following error message when I run resourceEditor. resourceEditor = =20 > actually loads, but the component menu is blank: > > Traceback (most recent call last): > File "C:\BigSnake\lib\site-packages\wx\_core.py", line 10673, in =20 > <lambda> > lambda event: event.callable(*event.args, **event.kw) ) > File =20 > "C:\BigSnake\Lib\site-=20 > packages\PythonCard\tools\resourceEditor\resourceEd > itor.py", line 85, in on_initialize > self.buildComponentsMenu() > File =20 > "C:\BigSnake\Lib\site-=20 > packages\PythonCard\tools\resourceEditor\resourceEd > itor.py", line 285, in buildComponentsMenu > resource.loadComponentModule(name) > File "C:\BigSnake\Lib\site-packages\PythonCard\resource.py", line =20 > 30, in loadC > omponentModule > raise ImportError, message > ImportError: cannot import module 'floatcanvas > > I am using python 2.3.4 and wxPython 2.5.2.8 for Python 2.3 > > I checked out PythonCard from CVS, and installed from the windows =20 > binary file created by this command: > python setup.py --bdist_wininst > > Any ideas? I have uninstalled python, wxPython and PythonCard and =20 > installed into a new location. Module floatcanvas does live in =20 > several locations in under my Python installation: > > ..\site-packages\PythonCard\components > ..\site-packages\PythonCard\samples > ..\site-packages\PythonCard\samples\floatCanvasTest > ..\site-packages\PythonCard\build\lib\Pythoncard\components > ..\site-packages\wx\lib > ..\site-packages\wx\demo > ..\site-packages\wx\lib\floatcanvas > ..\site-packages\wxPython\lib > > To ask a very Newbie question, when an import statement is made, how =20 > does python know where to look for the module? Could I possibly have = =20 > a path problem? > > I did not have this problem when I was using the 0.8 windows binary =20 > distro of PythonCard from sourceforge.net Hmm, I'm not seeing that problem on either my Windows or Mac box. The =20 PythonCard/components/floatcanvas.py module does its import of the =20 wxPython FloatCanvas class as from wx.lib.floatcanvas import FloatCanvas as FCanvas in order to avoid name collision problems. In resource.py it should be =20 attempting to load the component from the PythonCard/components =20 directory and for some reason on your box that is causing an exception. = =20 Does the floatCanvasTest sample also fail? This won't be exactly the same, but start Python and at the >>> prompt =20 type from PythonCard.components import floatcanvas and see if that also throws an exception. How about if you do that from = =20 the codeEditor shell? Does it make any difference what directory you =20 start in if you run from the command-line? You can check your path that Python uses to import modules and packages = =20 with the following lines in the shell: import sys sys.path Is anyone else working from cvs seeing this problem?! BTW, there is a problem with the actual wx.lib.floatcanvas module since = =20 Chris used the method name Move when he shouldn't have. It has been =20 changed to MoveImage along with the call to Move in the code, but that =20 isn't in wxPython 2.5.2.8, so you would have to change it yourself. If nothing else works, I suggest simply renaming =20 components/floatcanvas.py to floatcanvas.txt or something like that so =20 that the resourceEditor doesn't attempt to import it until we get this =20 problem figured out. ka |