Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. ImportError library not loaded - "Reason: image not found"
QtWS25 Last Chance

ImportError library not loaded - "Reason: image not found"

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
librarylibrary not loa
5 Posts 3 Posters 7.7k 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.
  • L Offline
    L Offline
    Lobstw
    wrote on 1 Dec 2015, 00:32 last edited by
    #1

    With XCode installed, Qt installed and then PyQt installed. I try running:

    from PyQt5 import QtCore
    And I get this error:
    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PyQt5/QtCore.so, 2): Library not loaded: @rpath/QtCore.framework/Versions/5/QtCore Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PyQt5/QtCore.so Reason: image not found

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcleary
      wrote on 1 Dec 2015, 15:57 last edited by
      #2

      The two .so files listed are where they supposed to be?

      How did you install PyQt?

      L 1 Reply Last reply 1 Dec 2015, 19:26
      0
      • M mcleary
        1 Dec 2015, 15:57

        The two .so files listed are where they supposed to be?

        How did you install PyQt?

        L Offline
        L Offline
        Lobstw
        wrote on 1 Dec 2015, 19:26 last edited by
        #3

        @mcleary yes they are. Installed from source with configure.py, make, sudo make install etc

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 1 Dec 2015, 21:46 last edited by
          #4

          Hi,

          Where are you running this script from ?

          One thing that can help is to set the DYLD_FRAMEWORK_PATH environment variable to point to your Qt 5 lib folder.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcleary
            wrote on 1 Dec 2015, 22:07 last edited by mcleary 12 Jan 2015, 22:07
            #5

            I'll suggest that you print some environment variables to check if the paths for the shared libraries are OK.

            So, from the environment you are trying to execute your python script, try to print PATH, PYTHONPATH and DYLD_LIBRARY_PATH

            Even better, you can try to print this from your python script with something like this

            import os
            print os.environ['PATH']
            print os.environ['DYLD_LIBRARY_PATH']
            print os.environ['PYTHONPATH']
            

            The check if the missing path is listed somewhere

            1 Reply Last reply
            0

            1/5

            1 Dec 2015, 00:32

            • Login

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