![](/img/trans.png)
[英]I got this error while using wxPython on windows “ import wx import error no module named wx ”
[英]“import wx” fails after installation of wxPython on Windows XP
我下载并安装了这个版本的wxPython ,用于我的Python 2.6安装:
http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe
当我运行Python并尝试导入wx时,我收到以下错误:
C:\Program Files\Console2>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
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 45, in <module>
from wx._core import *
File "c:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
>>>
我已经尝试删除wxPython并再次安装,我得到了同样的错误。 我该如何解决这个问题?
讨厌说这个,但我遇到了同样的问题,重启后导入工作正常。
尝试ANSI版本而不是Unicode版本。 IIRC需要匹配Python 2.6安装才能正常工作。
通过在wxPython trac系统中查找“应用程序配置不正确”,唯一可能有意义的参考是64位与32位兼容性问题。
顺便说一下,如果再次尝试卸载,请进入site-packages文件夹并确保删除所有wx和wxPython内容。
我也有同样的问题。更好的安装“Portable Python”IDE,它带有一些很好的模块,包括wxPython。你可以立即开始编码GUI,而无需下载单独的wxPython。链接, http://www.portablepython.com /
复制Microsoft C运行时库v.9文件和清单。 也就是说, msvcr90.dll
和microsoft.vc90.crt.manifest
从文件夹python
到文件夹wx,tha是包含无法启动DLL的文件夹。
或者安装Visual C ++ 2008 Redistributable Package。
也许为时已晚,但我遇到了同样的问题并通过从他们自己的网站下载来解决这个问题:wxPython2.8-win64-unicode-py27在我的情况下,它最初想要在我的python文件夹以外的地方设置。 所以我将它更改为../python27/Lib/SitePackages/然后它正常工作。
我希望它有所帮助。
另一个迟到的答案,但我最近有问题(8/14),我的解决方案是使用32位而不是64位wxPython版本。
您尝试使用模块wxpython 2.8.12.1版本,选择您的python版本。 您可以在这里下载:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.