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"
Forum Updated to NodeBB v4.3 + New Features

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 2 Watching
  • 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 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 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
      0
      • M mcleary

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

        How did you install PyQt?

        L Offline
        L Offline
        Lobstw
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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 last edited by mcleary
            #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

            • Login

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