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.QtGuiapp = PySide.QtGui.QApplication(sys.argv)
label = PySide.QtGui.Qlabel("Hello World")
label.show()
app.exec_()
sys.exit()The import fails as follows:
Traceback (most recent call last):
File "/Users/lewislevin/Dropbox/Python-code/QT-hello-world/Hello-world.py", line 4, in <module>
import PySide.QtCore
ImportError: dlopen(/Library/Python/2.7/site-packages/PySide/QtCore.so, 2): no suitable image found. Did find:
/Library/Python/2.7/site-packages/PySide/QtCore.so: mach-o, but wrong architectureI 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)
4.8.6But, there is this mach-o incompatibility. This is frustrating.
-
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?
-
@file /path/to/the_file_you_want_to_check@