Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem importing 4.2.2 #2614

Open
JamesRandom opened this issue Sep 24, 2024 · 6 comments
Open

Problem importing 4.2.2 #2614

JamesRandom opened this issue Sep 24, 2024 · 6 comments

Comments

@JamesRandom
Copy link

Operating system: MacOS Sonoma 14.6.1
wxPython version & source: 4.2.2 from pypi
Python version & source: 3.9.19

Description of the problem:

Attempting to import wx results in an error where __ZN10wxBoxSizer20InformFirstDirectionEiii is not found (see below for details).

The problem does not occur if I pip install wxpython==4.2.1

Code Example (click to expand)
$ python
Python 3.9.19 (main, Mar 20 2024, 19:50:25) 
[Clang 15.0.0 (clang-1500.1.0.2.5)] 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/jamie/Documents/Projects/python/timer/src/.venv/lib/python3.9/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/Users/jamie/Documents/Projects/python/timer/src/.venv/lib/python3.9/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: dlopen(/Users/jamie/Documents/Projects/python/timer/src/.venv/lib/python3.9/site-packages/wx/_core.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZN10wxBoxSizer20InformFirstDirectionEiii'
>>> 
@swt2c
Copy link
Collaborator

swt2c commented Sep 25, 2024

Is this an x86_64 or ARM processor? Did you install from a wheel or did you compile it yourself?

@DietmarSchwertberger
Copy link
Contributor

This is with a virtual environment? Does it work outside a virtual environment?

@reticulatus
Copy link
Contributor

For comparison, I have an Intel MacBook Pro using macOS Sequoia 15.0 and Python 3.11.9

I installed wxPython 4.2.2 using pip (not in a virtual environment).

It downloaded and installed wxPython-4.2.2-cp311-cp311-macosx_10_10_universal2.whl

I am able to import wx without any errors.

@swt2c
Copy link
Collaborator

swt2c commented Sep 29, 2024

In looking closer at this, I suspect the OP might be using an ARM64 Mac (would be nice if @JamesRandom could confirm). I noticed something: the 4.2.2 wheels for Python 3.8-3.10 are not shown as universal2, they are only shown as AMD64 only, whereas with 4.2.1, all macOS wheels are universal2. So, if the OP has an ARM Mac, it probably did not install a wheel and tried to build one, and failed somehow. I'll try to look into why we didn't get universal2 wheels for 3.8-3.10.

@swt2c
Copy link
Collaborator

swt2c commented Sep 29, 2024

So the answer to the last question seems to be that the default behavior is for the wheels to be built as the version that Python was compiled as, and the GitHub Actions Python installs for macOS for Python 3.8 through 3.10 are NOT universal2.

@JamesRandom
Copy link
Author

@swt2c You are right, I am running on an Arm-based Mac. And that it depends on the Python version.

Running with Python 3.12, I can install 4.2.2.
Python 3.10 and earlier fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants