Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1044907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:54:09+00:00 2026-05-16T15:54:09+00:00

I am running Python 2.7 under Mac OS 10.6.4, and I just installed wxPython

  • 0

I am running Python 2.7 under Mac OS 10.6.4, and I just installed wxPython from the wxPython2.8-osx-unicode-2.8.11.0-universal-py2.7.dmg binary. I am getting a weird error on the import wx line in my Python scripts. FYI, I can import the wx module just fine from PyCrust. I don’t really see what I have done wrong here. Could anyone please assist?

  File "prod_cons_wx.py", line 6, in <module>
    import wx 
  File "/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module>
    import _core_
ImportError: dlopen(/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so, 2): no suitable image found.  Did find:
    /usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no matching architecture in universal wrapper
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:54:09+00:00Added an answer on May 16, 2026 at 3:54 pm

    It appears that C extension modules included with the wxPython 2.7 dmg here are 32-bit only.

    $ cd /usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx
    $ file *.so
    _animate.so:   Mach-O universal binary with 2 architectures
    _animate.so (for architecture ppc): Mach-O bundle ppc
    _animate.so (for architecture i386):    Mach-O bundle i386
    _aui.so:       Mach-O universal binary with 2 architectures
    _aui.so (for architecture ppc): Mach-O bundle ppc
    _aui.so (for architecture i386):    Mach-O bundle i386
    ...
    

    Unfortunately, platform.architecture() does not give an accurate indication of which arch an OS X multiple architecture Python is running in. For example, using the 3-arch python.org installer for Python 2.7, platform.architecture() always reports 64-bit even when running in 32-bit mode:

    $ cd /Library/Frameworks/Python.framework/Versions/2.7
    $ file python2.7
    python2.7: Mach-O universal binary with 3 architectures
    python2.7 (for architecture i386):  Mach-O executable i386
    python2.7 (for architecture ppc7400):   Mach-O executable ppc
    python2.7 (for architecture x86_64):    Mach-O 64-bit executable x86_64
    $ arch -x86_64 ./python2.7 -c 'import platform, sys; print "{0}, {1:x}".format(platform.architecture()[0], sys.maxint)'
    64bit, 7fffffffffffffff
    $ arch -i386 ./python2.7 -c 'import platform, sys; print "{0}, {1:x}".format(platform.architecture()[0], sys.maxint)'
    64bit, 7fffffff
    $ arch -ppc ./python2.7 -c 'import platform, sys; print "{0}, {1:x}".format(platform.architecture()[0], sys.maxint)'
    64bit, 7fffffff
    

    The reliable way is to examine sys.maxint for Python 2 or sys.maxsize for Python 3.

    You don’t indicate in your question how you invoke Python. Is it via a shebang line in a script file? If so, you may not be running the Python you think you are. Also, you don’t indicate which Python 2.7 you have installed. For instance, there are currently two installers for Python 2.7 from python.org: one supports both 32- and 64-bit execution, the other is 32-bit only. Try the following:

    $ file $(python2.7 -c 'import sys;print(sys.executable)')
    /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: Mach-O universal binary with 3 architectures
    /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python (for architecture i386):   Mach-O executable i386
    /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python (for architecture ppc7400):    Mach-O executable ppc
    /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python (for architecture x86_64): Mach-O 64-bit executable x86_64
    

    So: if you have a multi-arch version of Python, you’ll need to force it to run in 32-bit mode to make use of the pre-compiled wxPython.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to convert datetime.ctime() values to Unicode. Using Python 2.6.4 running under
I am having trouble importing python packages only when running python from cmdline/console. However,
Is there any way to get the effect of running python -u from within
How do I find the full path of the currently running Python interpreter from
When running a Python program that reads from stdin, I get the following error:
I installed Python Mock module using PIP. When I try to import mock running
I have a mac osx As such I have the normal python that comes
When Python is running under Windows, time.localtime does not report the correct time if
I am running Python under windows. I face no problem in installing pysqlite package.
I'm running the Python CLI under Linux: bla:visualization> python Python 2.1.1 (#18, Nov 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.