ImportError library not loaded - "Reason: image not found"
-
wrote on 1 Dec 2015, 00:32 last edited by
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
-
wrote on 1 Dec 2015, 15:57 last edited by
The two .so files listed are where they supposed to be?
How did you install PyQt?
-
wrote on 1 Dec 2015, 19:26 last edited by
@mcleary yes they are. Installed from source with configure.py, make, sudo make install etc
-
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.
-
wrote on 1 Dec 2015, 22:07 last edited by mcleary 12 Jan 2015, 22:07
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/5