问题
发现装了pyqt5和pyqt5-tools,程序可以运行,但是一直跳转不到定义,如“cannot find reference QtWidgets in __init__.py”。
解决方法
首先:在pycharm setting 中找到Project Interpreter,然后找到PyQt5相关包升级到最新版;
然后核对以下打勾的包是否安装,若没安装,pip install ***即可(部分安装不了没关系);
最后,你要做的就是:File → Settings → Editor → File Types → Ignore files and folders,干掉框框中的:__init__.py;,然后:OK等待重新文件扫描,如果还不行,那就:File → Invalidate Caches / Restart,选择Invalidate and Restart,等待重新扫描库文件就好了,这次就妥妥的没问题了。