Hi everyone,
I hope this is the right list as the description for the wxPython-mac Mailing List says:
"Discussions about porting wxPython to the Apple Macintosh are held on this list. "
I just installed wxWidgets or wxMac successfully ( Or so I think )
I downloaded the latest installer for wxPython-mac and can't seem to run any wxPython Apps, namely:
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Instead of seeing a Window, I get back an error message:
Traceback (most recent call last):
File "wx.py", line 1, in ?
from wxPython.wx import *
ImportError: No module named wxPython.wx
I am currently using OS Xv10.3.2 and Python v2.3
I can't find MachoPython anywhere and from what I've read, it seems like I should have it on my system.
What am I missing?
Thanks in advance.
-gohaku
the code you used is very old.... there is a new way of doing things these days:
import wx
class MyApp(wx.App):
def OnInit(self):
frame = wx.Frame(None, -1, "Hello from wxPython")
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp(0)
app.MainLoop()
Anyways... something else might be wrong since it should have found the old namespace... try to see if wx is in site-packages. if is not there... there might be problems with the installer
···
On Sat, 24 Apr 2004 11:41:15 -0400, gohaku <gohaku@earthlink.net> wrote:
Hi everyone,
I hope this is the right list as the description for the wxPython-mac Mailing List says:
"Discussions about porting wxPython to the Apple Macintosh are held on this list. "
I just installed wxWidgets or wxMac successfully ( Or so I think )
I downloaded the latest installer for wxPython-mac and can't seem to run any wxPython Apps, namely:
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Instead of seeing a Window, I get back an error message:
Traceback (most recent call last):
File "wx.py", line 1, in ?
from wxPython.wx import *
ImportError: No module named wxPython.wx
I am currently using OS Xv10.3.2 and Python v2.3
I can't find MachoPython anywhere and from what I've read, it seems like I should have it on my system.
What am I missing?
Thanks in advance.
-gohaku
Hi everyone,
I hope this is the right list as the description for the wxPython-mac Mailing List says:
"Discussions about porting wxPython to the Apple Macintosh are held on this list. "
I just installed wxWidgets or wxMac successfully ( Or so I think )
I downloaded the latest installer for wxPython-mac and can't seem to run any wxPython Apps,
2.5.1.5? or 2.4.2.4? Make sure you get the installer (for either version) specifically built for Panther.
namely:
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
Instead of seeing a Window, I get back an error message:
Traceback (most recent call last):
File "wx.py", line 1, in ?
from wxPython.wx import *
ImportError: No module named wxPython.wx
Which python did you run it with? Was it Apple's python installed with Panther, one that may have been left over from a prior Jaguar install, or one installed via Fink? Type "which pythonw" from a Terminal window, it should say "/usr/bin/pythonw" which should be Apple's framework build of Python. (You need to run GUI apps with pythonw, not plain python.)
If you are using the right Python and it still gives you the ImportError then look in /Library/Python/2.3. You should find there wx and wxPython subdirectories, which are the two top-level pacakges for wxPython. If they are not there then you probably installed a version built for Jaguar.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!