Search code examples
pythonpython-3.xwxpython

wxPython not working with Python 3.7 (on Windows 7, 64bit)?


I'm trying to run wxPython with Python 3.7 (on Windows 7 64bit), but I keep getting an error message stating the dll couldn't be found:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Joel\AppData\Local\Programs\Python\Python37\lib\site-packages\wx\__init__.py", line 17, in <module>
    from wx.core import *
  File "C:\Users\Joel\AppData\Local\Programs\Python\Python37\lib\site-packages\wx\core.py", line 12, in <module>
    from ._core import *
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

I have tried reinstalling, including different versions of both Python and wxPython, here's what I found out:

  • Python 3.6 with wxPython 4.0.2 - works
  • Python 3.6 with wxPython 4.0.3 - works
  • Python 3.7 with wxPython 4.0.3 - does NOT work
  • Python 3.7 with wxPython 4.0.2 - does NOT work

In all cases, wxPython was installed via pip.

Obviously, the error is present only in Python 3.7 regardless of wxPython version.

Surprisingly, in the wxPython directory there is a file _core.cp36-win_amd64.pyd resp. _core.cp37-win_amd64.pyd in the Python 3.6 as well as 3.7 installation. So to me it seems the missing dll is present in both versions, and yet cannot be found...

Does anybody know what went wrong here?


Solution

  • According to Robin Dunn, creator of wxPython: "The Microsoft DLLs were accidentally forgotten in the latest release, so if your machine doesn't have them installed, then you will need to install them separately for now. You can get them here: https://www.microsoft.com/en-us/download/details.aspx?id=52685"

    They will be added back in the next release of wxPython though (presumably 4.0.4)