Pycharm, PyQt5, and Python 2.7 — No code completion

不羁岁月 提交于 2019-12-03 00:30:28

I am using PyCharm4(community Edititon) on Windows with PyQt4, the autocomplete is fine. As PyQt4 is actually a dynamic library to be dynamic loaded by the python interpreter ( you can look into the PyQt4 folder, there is no python files there except some init.py), auto-complete depends on the source code of PyQt4 itself, so when using pycharm, it usually generally some local python cache for complete. For my machine, a typically file looks like: C:\Users\cui.PyCharm40\system\python_stubs-762174762\PyQt4\QtCore\QString.py

You can also try install PyQt document from Pycharm. File->settings->Tools->python external document->PyQt

Can you find PyQt5 from your project's External Libraries? If you install it through pip, you should be able to see the library directly. Once the library can be referred, it will do the code-completion for you.

Had the same problem in PyCharm 2017.1.1. Don't do

import PyQt5.QtWidgets

do

from PyQt5 import QtWidgets
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!