Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

DLL load failure error in wxPython

This is my first time using wxPython Python can go theatre my code

import wx
app=wx.App()
win=wx.Frame(None, -1, 'Window Title')
win.Show()
app.MainLoop()

This is the Error i'm getting:

Traceback (most recent call last):
  File "C:/Users/sancios/Desktop/huluhup", line 1, in <module>
    import wx
  File "C:Python27libsite-packageswx-3.0-mswwx\__init__.py", line 45, in <module>
    from wx._core import *
  File "C:Python27libsite-packageswx-3.0-mswwx\_core.py", line 4, in <module>
    import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It sounds like you are mixing Python and wxPython versions. They must match. For example, if I have Python 2.7 32-bit, then I need a wxPython 3.0 32-bit for Python 2.7. You cannot install a wxPython that is 64-bit with a Python 32-bit (or vice versa) and expect it to work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...