PySide won't run in console

Mac OS X 10.9.4
Python 2.7.8
PySide 1.2.2
Qt 4.8.6

I have a couple of tiny scripts from the PySide tutorial to test if my PySide and Qt install works.  Proof is that they run if I execute them from python in terminal.

But, they always fail when run in the console:  

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/core/interactiveshell.py", line 2883, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-b11c9c5d82ed>", line 4, in <module>
    from PySide import QtGui
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PySide/QtGui.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PySide/QtGui.so: mach-o, but wrong architecture


Everything is x86_64 architecture:  Python, the PySide dynlibs, and PySide .so files (python dyn libs).  The proof that the install is ok would seem to be that the same python interpreter can run these little scripts.

Here is one of them:  simple.py
  1. !/usr/bin/python
  2. -*- coding: utf-8 -*-

  3. simple.py

import sys
from PySide import QtGui

app = QtGui.QApplication(sys.argv)

wid = QtGui.QWidget()
wid.resize(250, 150)
wid.setWindowTitle('Simple')
wid.show()

sys.exit(app.exec_())


Any clues as to why this won't run from the PyCharm console?  

(BTW–I can start a terminal tool in PyCharm, run Python, and then import the script and it works.)
1 comment
Comment actions Permalink
This problem is still outstanding.  I reinstalled PySide because that helped in the case of other modules.

However, that did not fix the problem.

Also, I think this is  PyCharm problem.  The code runs when in python independent of the IDE.

Also, at least one other IDE I tried runs the simple test script and successfully does the import for PySide.QtGui.

Again, something is wrong with the way PyCharm creates the console process.

It seems simple enough to reproduce.  It would be nice to fix.
0

Please sign in to leave a comment.