Important: Please read the Qt Code of Conduct -

Mach-o, but wrong architecture

  • This appears to be a constant refrain.

    Attempting to run a simple tutorial app:

    import sys
    import PySide.QtCore
    import PySide.QtGui

    app = PySide.QtGui.QApplication(sys.argv)
    label = PySide.QtGui.Qlabel("Hello World")

    The import fails as follows:

    Traceback (most recent call last):
    File "/Users/lewislevin/Dropbox/Python-code/QT-hello-world/", line 4, in <module>
    import PySide.QtCore
    ImportError: dlopen(/Library/Python/2.7/site-packages/PySide/, 2): no suitable image found. Did find:
    /Library/Python/2.7/site-packages/PySide/ mach-o, but wrong architecture

    I initially installed PySide with pip and ran the post install script. Import works and the version can be displayed with the trivial test.

    But, it produced same message. I uninstalled with pip (which doesn't really work of course as PySide is scattered to many places. generally, you should have a reliable uninstaller. Perish the thought that someone might ever want to uninstall...)

    Then, I used brew and to install a build Pyside, which installed a new copy of QT. Everything is at version 4.8.6. The trivial test works:
    Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.

    import PySide
    import PySide.QtCore
    print (PySide.QtCore.version)

    But, there is this mach-o incompatibility. This is frustrating.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You might be mixing 32bit and 64bit libraries. You can check that with the file command

  • How do you run that command?

  • Lifetime Qt Champion

    @file /path/to/the_file_you_want_to_check@

Log in to reply