So I can install wxpython4.2.2 on windows 10 (latest update) using python 3.10. But when I use python 3.12.6 I get the following issue:
Python 3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)] on win32
import wx
Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\Python312\Lib\site-packages\wx_init_.py”, line 17, in
from wx.core import *
File “C:\Program Files\Python312\Lib\site-packages\wx\core.py”, line 12, in
from ._core import *
ImportError: DLL load failed while importing _core: The specified module could not be found.
I believe the module is the agw module and it might be something with the gradientbutton. This is the first issue I have seen with wxpython 4.2.2 (I have successfully installed on windows 10 without issue). Sure could use some help here…
I am unclear how that is related to AGW… your traceback shows that your installation breaks in wx._core, which is well before anything in AGW is looked at.
When I try to debug the issue I get an error stating that python can not load the module agw. When I then try to stop the debugger within agw I get an other error which suggest that it can not load gradientbutton. But I have gone down the wrong path many times. So i might be way off base.
I have never run into this issue in the past and I have installed python 3.12.6 with wxPython 4.2.2 on at least 50 computers without issue. It is the first time I have run into an issue of this type.
It sounds like no else has had this issue because I haven’t had any leads on how to fix this.
You can compare it to the contents of the wxPython wheel file. If you don’t find any missing files, it could possibly be some sort of DLL path search issue, but I don’t really have any further ideas. Maybe someone who knows more about Windows can chime in.
This is what I get after adding the try in core.py
PS C:\Users\admin> python
Python 3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import wx
DLL load failed while importing core: The specified module could not be found.
Traceback (most recent call last):
File “”, line 1, in
File "C:\Python312\Lib\site-packages\wx_init.py", line 17, in
from wx.core import *
File “C:\Python312\Lib\site-packages\wx\core.py”, line 143, in
BG_STYLE_CUSTOM = BG_STYLE_PAINT
^^^^^^^^^^^^^^
NameError: name ‘BG_STYLE_PAINT’ is not defined