Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. [Solved] PySide new Mac OS install can't load QtCore.so

[Solved] PySide new Mac OS install can't load QtCore.so

Scheduled Pinned Locked Moved Language Bindings
3 Posts 1 Posters 16.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dcortesi
    wrote on last edited by
    #1

    The problem was that the various Qt<etc>.framework directories did not exist in /Library/Frameworks. I looked at a system where PyQt4 runs and saw that they were there. On this machine, although I ran the Qt installer, it did not place the necessary frameworks in /Library/Frameworks where apparently Python expects them. I used
    @sudo cp -pvR /Developer/SDKs/QtSDK/Desktop/Qt/473/gcc/lib/*.framework /Library/Frameworks@
    to make copies, and immediately, PySide came up.

    I hope this benefits somebody although I have no idea why the Qt installer did not do this.

    ---- original question ---
    New installation of Qt and PySide on a MacPro desktop machine with Snow Leopard. PySide attempts to load QtCore.so (which does exist in the site-packages/PySide folder) but an error occurs:
    @>>> import PySide
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Library/Python/2.6/site-packages/PySide/init.py", line 2, in <module>
    import private
    File "/Library/Python/2.6/site-packages/PySide/private.py", line 2, in <module>
    from QtCore import __moduleShutdown
    ImportError: dlopen(/Library/Python/2.6/site-packages/PySide/QtCore.so, 2): Library not loaded: QtCore.framework/Versions/4/QtCore
    Referenced from: /Library/Python/2.6/site-packages/PySide/QtCore.so
    Reason: image not found@
    I tried forcing python2.6 to run in 32-bit mode, but this only changed the message to read:
    @ImportError: dlopen(/Library/Python/2.6/site-packages/PySide/QtCore.so, 2): no suitable image found. Did find:
    /Library/Python/2.6/site-packages/PySide/QtCore.so: mach-o, but wrong architecture@

    (I know I am not alone in this experience, as I found the identical issue posted at Quora.com!)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dcortesi
      wrote on last edited by
      #2

      Well, a day passes, 23 views, no suggestions. Just to make sure, I downloaded PySide and re-installed it, also re-installed Qt, and rebooted. Symptoms the same (see listing in original post). Several significant things here that I don't understand.

      The first error message is
      @ImportError: dlopen(/Library/Python/2.6/site-packages/PySide/QtCore.so, 2)@
      The second message is
      @Library not loaded: QtCore.framework/Versions/4/QtCore@
      Now the latter exists as part of the Qt SDK. Which I installed in /Developer/SDKs/QtSDK -- which is not the default install location.

      Where does python look for the Qt SDK? Do I need to set some kind of environment variable to help it?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dcortesi
        wrote on last edited by
        #3

        I have set a symbolic link ~/QtSDK to where I installed Qt, so it should look as if it was installed in the default location.

        Also I have exported DYLD_LIBRARY_PATH=/Developer/SDKs/QtSDK/Desktop/Qt/473/gcc/lib/

        Neither step makes any difference, the message is the same as before.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved