被这个错误折磨了一下午,关键时刻还得靠Google,原因是下载的wxPython是adm64的,安装的Python是32位的,一定要下载相匹配的文件。
There are multiple versions available. The easiest way to try, did you install the correct version for you is to start cmd and type:
1) python
2) import wx
3) import wxversion
4) print wxversion.getInstalled()
if errors happen on steps 1-3 then there is something wrong in your installation and reinstallation should fix it. On the step 4 output you can compare to the ride installation requirements.
试到第二步眼睛陡然一亮发现了“不是有效的 Win32 应用程序”,got it!
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 4
5, in <module>
from wx._core import *
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, i
n <module>
import _core_
ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
重新下载wxPython:wxPython2.8-win32-unicode-2.8.12.1-py27.exe
http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
本文记录了作者在安装wxPython过程中遇到的位数不匹配错误,并提供了详细的解决步骤。作者发现安装的wxPython版本与Python版本位数不符导致无法正常运行,通过重新下载与Python版本匹配的wxPython解决了该问题。
1527

被折叠的 条评论
为什么被折叠?



