[Pythonmac-SIG] [Newbie] Problem running wxPython script

John Hazen john at hazen.net
Sat Apr 24 15:42:42 EDT 2004


* gohaku <gohaku at earthlink.net> [2004-04-24 09:58]:
> 
> I use "pythonw" to run the script but get the following:
> 
> Traceback (most recent call last):
>   File "wx.py", line 1, in ?
>     from wxPython.wx import *
>   File "//Library/Python/2.3/wxPython/__init__.py", line 10, in ?
>     import _wx
>   File "//Library/Python/2.3/wxPython/_wx.py", line 3, in ?
>     from core import *
>   File "//Library/Python/2.3/wxPython/core.py", line 15, in ?
>     import wx.core
-------------^^
>   File "/Users/johndoe/Desktop/wx.py", line 1, in ?
>     from wxPython.wx import *
> ImportError: No module named wx
> 
> I am losing my mind searching newsgroups and the Web to see If I missed 
> anything.

Hi Gohaku-

Try naming your file something other than "wx.py".  The default sys.path
puts the current directory first in the search order, so internal to
wxPython, it's trying to import your file, instead of the "wx" module
that comes with wxPython.

HTH-

John



More information about the Pythonmac-SIG mailing list