简体   繁体   中英

“import wx” fails after installation of wxPython on Windows XP

I downloaded and installed this version of wxPython for use with my Python 2.6 installation:

http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe

When I run Python and try to import wx, I get the following error:

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.
>>>

I have already tried removing wxPython and installing again and I got the same error. How can I fix this problem?

I was getting the same error.

After some googling found this link to MSVC++ 2008 Redestributable and installed it.

That solved the problem.

讨厌说这个,但我遇到了同样的问题,重启后导入工作正常。

Try the ANSI version instead of the Unicode one. IIRC it needs to match the Python 2.6 install to work properly.

From looking for "application configuration is incorrect" in the wxPython trac system , the only reference that might make sense is a 64-bit vs 32-bit compatibility issue.

Otherwise, I'd say Brian's answer of trying ANSI is pretty good.

BTW, if you try uninstalling again, make go into the site-packages folder and make sure all the wx and wxPython stuff is deleted.

我也有同样的问题。更好的安装“Portable Python”IDE,它带有一些很好的模块,包括wxPython。你可以立即开始编码GUI,而无需下载单独的wxPython。链接, http://www.portablepython.com /

Copy the Microsoft C runtime library v.9 files and manifest. That is, msvcr90.dll and microsoft.vc90.crt.manifest from folder python to the folder wx, tha is, folder which contains failed to start DLLs.

Or install the Visual C++ 2008 Redistributable Package.

Maybe too late, but I had the same problem and solved that by downloading that from their own website : wxPython2.8-win64-unicode-py27 In my case it initially wanted to setup in somewhere else than my python folder. So I changed it to be in ../python27/Lib/SitePackages/ Then it worked properly.

I hope it helps.

另一个迟到的答案,但我最近有问题(8/14),我的解决方案是使用32位而不是64位wxPython版本。

you try to use the module wxpython 2.8.12.1 version, select the version of your python. you can download it here:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#wxpython

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM