I'm having some troubles with PyQt. I've installed PyQt4 and PyqQt5 through Homebrew, and I planned on using PyQt4 for a particular project I'm working on. However, I have some strange issues getting it to work.
In one module, we'll call it A, I'm using these imports:
from OpenGL.GL import *
from OpenGL.GLU import *
from PyQt4 import QtGui
from PyQt4.QtOpenGL import *
Now, PyQt4 is red underlined with 'unresolved reference to PyQt4'. However, this code runs. If I change it to PyQt5, there is no underline:
from OpenGL.GL import *
from OpenGL.GLU import *
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtOpenGL import *
But, I get this error when running:
Traceback (most recent call last):
File "/Users/Jordan/PycharmProjects/SimpleCAD/QGLWindow.py", line 6, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: No module named PyQt5
Now, I have another window in my program, which I've taken care of in a different module, B. Those imports look like this:
import sys
from PyQt4 import QtGui
When I run this code, I get this error:
Traceback (most recent call last):
File "/Users/Jordan/PycharmProjects/SimpleCAD/QTMainWindow.py", line 2, in <module>
from PyQt4 import QtGui
ImportError: No module named 'PyQt4'
So, what's going on with my imports here? Why does PyQt4 work in one module, but not another? And why am I getting warnings for PyQt4 imports that work in one module, but none for the unworking PyQt5 imports? Thanks for any help in advance.