Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyQt5 not working on macOs sierra

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

like image 244
dman Avatar asked Mar 09 '23 07:03

dman


1 Answers

Finally got it working , after 1 million fruitless tries.

  1. Get homebrew then brew install pyqt.
  2. LDFLAGS=-L/usr/local/opt/qt/lib CPPFLAGS=-I/usr/local/opt/qt/include pip3 install PyQt5 all on 1 line.

Then viola !

like image 73
dman Avatar answered Mar 30 '23 17:03

dman