WxPython、Windows Vista 64位及其故障

1 投票
1 回答
1388 浏览
提问于 2025-04-15 16:48

我使用的是Windows Vista 64位 SP2系统。我想用wxPython来开发图形界面,因为我做了很多研究,发现这个是最好的选择。我已经下载并安装了win64版本的wxPython,但每次都出现同样的错误。

Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.

>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 4
5, in <module>
    from wx._core import *
  File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, i
n <module>
    import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application.

我在C盘上安装了Python,具体是在C:\Program Files (x86)下安装了Python 2.6,并且在那儿安装了wxPython。我试过32位和64位的版本。我到处搜索类似的问题,但几乎没有看到其他人遇到过这个问题。任何帮助都将非常感激。

1 个回答

6

看起来你是想在32位的Python上运行64位的wxPython。其实你需要确保它们都是同一种架构,要么都是64位,要么都是32位。

撰写回答