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.

+3


source to share


3 answers


The problem was solved by installing PyCharm first and then Python and PyQt.

Afterwards I had to set up the interpreter in PyCharm and it worked.



When I posted the question, I installed Python, then PyQt, and then PyCharm.

Oddly enough, it worked in this order on another PC.

+1


source


I had the same problem for Linux, pyqt5 and pycharm CE. The solution was to rebuild the skeletons with:    File> Invalid Cache / Restart> Invalid and Restart.



+12


source


I recently moved on to the same problem. Unfortunately the installation order didn't resolve for me.

There is a bug report here . Downloading the Early Access version worked and can be found here

0


source







All Articles