0

I'm running Python 2.7 and wxPython 2.8 on 64-bit Windows 7 (but Python and wx are both the 32-bit versions).

I'm trying to import the module, but import wx returns an error:

Traceback (most recent call last):
  File "C:/Users/Adam/Desktop/test", line 4, in <module>
    import wx
  File "C:\Users\Adam\Desktop\test.py", line 8, in <module>
    class MyFrame(wx.Frame):
AttributeError: 'module' object has no attribute 'Frame'

From research I think I've not set up some enviroment variables correctly, but everywhere I look no one actually says what I need to add to what variables.

Thanks a lot!

4
  • That's not an error, that's a fragment of a traceback. Commented Sep 25, 2011 at 18:33
  • Oops, apparently I can't copy & paste. But it seems to be not importing correctly. Fixed the error text. Commented Sep 25, 2011 at 18:37
  • That sounds more like a broken wxPython build than an actual import error. Commented Sep 25, 2011 at 18:41
  • I installed it no less than a half hour ago with the latest stable build... Commented Sep 25, 2011 at 18:44

1 Answer 1

2

The only thing that comes to mind is that you've called something else "wx.py". Print the value of wx.__file__ to verify, and then rename it.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah, thank you. That's what I get for naming the file I was using to test wxPython wx.py.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.