Python 3.8.16 (default, Jun 23 2024, 20:41:42)
[GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import wx
Traceback (most recent call last):
File “”, line 1, in
File “/home/luo/myproject/venv/lib/python3.8/site-packages/wx/init.py”, line 17, in
from wx.core import *
File “/home/luo/myproject/venv/lib/python3.8/site-packages/wx/core.py”, line 12, in
from ._core import *
ModuleNotFoundError: No module named ‘wx._core’
pip list:
Package Version
I don’t know much about wheels, but am I right in assuming that wxPython-4.2.1-cp38-cp38-win_amd64.whl is built to run on Windows and will contain binary extensions compiled for Windows?
So how does just renaming it as a wheel for manylinux allow the code to run on linux?
I am having the same problem. Part of the problem I find frustrating is that most of the answers appear to be coming from wheels experts to wheels experts, and they are suggesting weird things such as renaming .whl files in ways that are nonsensical.
jeffs@frmwrk16:~/Downloads$ pip install --force-reinstall --break-system-packages -U -f $URL wxPython
Defaulting to user installation because normal site-packages is not writeable
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
Looking in links: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-24.04
Collecting wxPython
Using cached https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-24.04/wxpython-4.2.5-cp312-cp312-linux_x86_64.whl (151.2 MB)
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
Installing collected packages: wxPython
Attempting uninstall: wxPython
Found existing installation: wxPython 4.2.5
Uninstalling wxPython-4.2.5:
Successfully uninstalled wxPython-4.2.5
Successfully installed wxPython-4.2.5
jeffs@frmwrk16:~/Downloads$ python
Python 3.12.3 (main, Mar 3 2026, 12:15:18) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jeffs/Downloads/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/home/jeffs/Downloads/wx/core.py", line 12, in <module>
from ._core import *
ModuleNotFoundError: No module named 'wx._core'
>>>
I tried to do some troubleshooting, but my skills are not up to the task.
@jeffsilverm I think part of the problem is that you have a wx directory in your Downloads folder, which contains a suspicious set of files (both Python 3.12 and 3.13??), but it seems you are trying to use an installed wheel? When running import wx Python will usually try the current directory for locating modules to import.
First, I would just try cd’ing out of the Downloads directory and try running your test again.
BTW, using --break-system-packages seems dangerous.