SOLVED: Brew+ python3+ pyqt5: ModuleNotFoundError: No module named 'sip'


When you start electrum or a software that uses PyQt5 with python3 you get a similar error:

electrum/gui/qt/__init__.py", line 35, in <module>
    from PyQt5.QtGui import *
ModuleNotFoundError: No module named 'sip'

To solve this issue first uninstall PyQt5 and then install sip with python3 support

brew uninstall pyqt5
brew install pyqt5 --with-python3

If you still get the module not found error and you are using virtualenv, check this commands: Make sure the path to your venv is the correct one.

ln -s  /usr/local/lib/python3.6/site-packages/sip.so /Users/youruser/.pyenv/versions/electrum/lib/python3.6/site-packages/sip.so
ln -s  /usr/local/lib/python3.6/site-packages/sip.pyi /Users/youruser/.pyenv/versions/electrum/lib/python3.6/site-packages/sip.pyi