Hey everyone,
I’m relatively new to wxPython and have been trying to get a simple app up and running. However, I keep running into this error:
AttributeError: module 'wx' has no attribute 'App'
Here’s a snippet of my code:
import wx
class MyApp(wx.App):
def OnInit(self):
frame = wx.Frame(None, -1, 'Hello wxPython')
frame.Show(True)
return True
app = wx.App(False)
app.MainLoop()
I’m not sure what’s going wrong here. When I was searching about this, I came across to these resources/articles AttributeError: module 'wx' has no attribute 'App' mulesoft interview questions python - Error with wxPython - partially initialized module 'wx' has no attribute 'Frame' (most likely due to a circular import) - Stack Overflow as per them I have double-checked my wxPython installation and it seems to be fine. I’m running Python 3.8 on Windows 10, and I’ve installed wxPython using pip install wxPython
.
Has anyone encountered this issue before or know what might be causing it? Any help or suggestions would be greatly appreciated!
Thanks in advance!
Best Regards