AttributeError: module 'wx' has no attribute 'App'

Hello, I am new to python and consequently in wxpython I am trying to run the code of hello world then having the error that I described at the top. I thank you if you can help me.

Traceback (most recent call last): File “/home/nilton/exercicios/wx.py”, line 2, in import wx File “/home/nilton/exercicios/wx.py”, line 5, in app = wx.App() AttributeError: module ‘wx’ has no attribute ‘App’

The file /home/nilton/exercicios/wx.py is being imported when you do import wx, so the wxPython package is not found. Change your module name.

1 Like

thank you I’ll try later I send the result

hi,i am meeting the same trouble as yours,if you solved it,please tell me the method. As a new guy,
i hope we can help each other.

@xiaoli make sure your own file is not named wx.py

the trouble is still running,although my file‘s name is changed 。

thanks, i have sloven my question with spending five hours
the reason to trouble is script . if ‘wx.App’ changed with ‘wx.app’,’wx‘ will not check up the App order.
Thanks very much to your reply my question again.
bless you