I don’t have experience with PyCharm either, but you’ll get errors like
these if required binaries can’t be found.

If you got the official Riverbank distribution, then it’ll add the PyQt4
directory to your PATH. It’s possible that PyCharm modifies this which
would cause an error like this.

You could very this if you add this before *using* the PyQt libraries (e.g.
before instantiating QApplication).

import osimport PyQt4

os.environ["PATH"] += ";" + os.path.dirname(PyQt4.__file__)

That’ll expose the binaries again, at which point you should be able to use
PyQt4 regardless of alterations to your PATH.

Another possibility is if PyCharm chooses to use another executable for
Python.

PyQt needs a qt.conf file next to wherever the executable is, so if it’s
different its likely it won’t be there.

You can verify this by printing this in debugging mode.

import osimport sys

dirname = os.path.dirname(sys.executable)
qtconf = os.path.join(dirname, "qt.conf")print "qt.conf OK" if
os.path.isfile(qtconf) else "qt.conf MISSING"

​

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAymPK4d-vO%2BU8hr7sS86bVWwVeazeixXa7qRWJhYPgMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to