import wx
# 导入wxPython
class App(wx.App):
# 初始化方法
def OnInit(self):
frame = wx.Frame(parent=None, title='Hello wyPython')
frame.Show()
return True
if __name__ == '__main__':
app = App()
app.MainLoop()
######报错结果
"D:\Program Files\Python3.9\python.exe" C:/Users/Anch/PycharmProjects/pythonProject1/student/learn.py
Traceback (most recent call last):
File "C:\Users\Anch\PycharmProjects\pythonProject1\student\learn.py", line 2, in
import wx
File "D:\Program Files\Python3.9\lib\site-packages\wx_init_.py", line 17, in
from wx.core import *
File "D:\Program Files\Python3.9\lib\site-packages\wx\core.py", line 12, in
from ._core import *
ImportError: DLL load failed while importing _core: 找不到指定的程序。