No autocomplete for PyQt4 in PyCharm
On my office PC, I am using
- Python 3.4
- PyQt4 Version 4.11.1
- PyCharm Community Eddition 3.4.1
I installed everything in the order shown above.
However, code completion doesn't work. It works for imports, but not for classes and methods.
I did a little test program:
import sys
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
window = QtGui.QWidget()
window.setWindowTitle("Test")
window.resize(300, 200)
window.show()
sys.exit(app.exec_())
In the above code, none of the classes or methods were suggested by PyCharm.
If I type window.setW
, I expect him to suggest setWindowTitle()
, but it doesn't.
The weird thing is that I use the same setup on my computer at home and there it works like a charm (Py) ... Autocomplete, auto-import, etc. As far as I remember, I installed it the same way as I did on my office PC.
I have already looked at several similar questions, but this question has no answers and the others do not contain relevant information that has helped me so far.
Don't know if this is relevant, but in this line
from PyQt4 import QtGui
PyCharm tells me
Unresolved reference "QtGui"
Maybe the reason for this is the same.
source to share