Reputation: 137
I have been trying to use the pyqt5 library for close to over an 5 hours now, it keeps on saying:-
from PyQt5.QtGui import *
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/PyQt5/QtGui.so, 2): Library not loaded: @rpath/QtGui.framework/Versions/5/QtGui
Referenced from: /usr/local/lib/python3.6/site-packages/PyQt5/QtGui.so Reason: image not found
Upvotes: 4
Views: 4972
Reputation: 1445
I also encountered this problem with pyqt installed via conda, when importing the following:
from PyQt5 import QtGui, QtCore
Updating the package solved the problem for me.
pyqt: 5.6.0-py36_1 conda-forge --> 5.6.0-py36h8210e8a_6 conda-forge
Note that there's also a new version available (pyqt 5.9.2), but this update resolved my issue.
Upvotes: 0
Reputation: 137
Finally got it working , after 1 million fruitless tries.
LDFLAGS=-L/usr/local/opt/qt/lib CPPFLAGS=-I/usr/local/opt/qt/include pip3 install PyQt5
all on 1 line. Then viola !
Upvotes: 7