PyCharm 无法解析对 PyQT5 模块的引用 [英] PyCharm can't resolve references to PyQT5 modules

查看:40
本文介绍了PyCharm 无法解析对 PyQT5 模块的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习如何使用 PyQT5.我在我的用户配置文件下创建了一个新文件夹,并在名为 env 的文件夹中启动了一个 virtualenv(并从 pip3 安装了 PyQT5).我在另一个名为 guis 的文件夹中创建了该项目,并将 PyCharm 指向了 env 环境.Pycharm 找不到子模块,但可以看到 PyQT5.QtWidgets 就好了.

I'm trying to learn how to use PyQT5. I created a new folder under my user profile and spun up a virtualenv (and installed PyQT5 from pip3) in a folder called env. I created the project in another folder called guis and pointed PyCharm to the env environment. Pycharm can't find the submodules but sees PyQT5.QtWidgets just fine.

截图:

推荐答案

我通过从

Settings > Project > Project Interpreter

在 PyCharm 中重新安装.

之后重启 PyCharm.

Restart PyCharm afterwards.

这篇关于PyCharm 无法解析对 PyQT5 模块的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆