wxPython 4.1.2 snapshot on Apple M1 Silicon error (PyInit_core)

I am trying the latest 4.1.2 snapshots on a MacBook Air (M1 silicon) with an existing wxPython app.

If I install wxPython 4.1.1 from PyPi the app runs ok (in a venv).

If I install wxPython 4.1.2 from downloaded snapshot the app does not run.
If I run a python shell and try to import wx I get errors (below).

Any ideas how to solve this?

Thanks, Brendan.

(venv3.10) brendan@XXX % python
Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Brendan/XXX//venv3.10/lib/python3.10/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/Users/Brendan/XXX/venv3.10/lib/python3.10/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: dynamic module does not define module export function (PyInit__core)
1 Like

I am also seeing this on my M1 MacBook Pro.

I also just noticed this is happening again. There are some instructions here in another thread that should help you build your own wheels. (You’ll need Xcode, etc.)

Thanks I followed those instructions. Worked great.

The universal builds should be fixed in tonight’s snapshot build.

The issue was that Homebrew Pythons were present on the build machines, and the venv’s used for the builds were based on them instead of the stock Python, and Homebrew binaries are single architecture. So even though the wxWidgets libs had both architectures, the wxPython extension modules ended up with just the architecture of the build machine and would then end up with the ImportError shown above when used on the other architecture.

I’ll give the snapshot build a “shot” mañana :yum:

Sorry mañana was a long time coming. This now works as expected. Thank You

Hey @Robin , I’m getting this error - This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for wxpython

Running setup.py clean for wxpython

Failed to build wxpython

ERROR: Could not build wheels for wxpython, which is required to install pyproject.toml-based projects

(dlclive) maniksinghsarmaal@Maniks-MacBook-Pro site-packages % pip install wx

ERROR: Could not find a version that satisfies the requirement wx (from versions: none)

ERROR: No matching distribution found for wx. CAN YOU PLS HELP ME I GOT THIS ERROR WHILE pip installing ‘deeplabcut[gui]’ , I’VE SEARCHED A LOT AND COULDN’T FIND IT