我 pip 安装了 PyQt5,并在我的 CMD 中验证了这一点pip show PyQt5:C:\Users\92175>pip show PyQt5Name: PyQt5Version: 5.15.0Summary: Python bindings for the Qt cross platform application toolkitHome-page: https://www.riverbankcomputing.com/software/pyqt/Author: Riverbank Computing LimitedAuthor-email: info@riverbankcomputing.comLicense: GPL v3Location: c:\python\python37-32\lib\site-packagesRequires: PyQt5-sipRequired-by:当我在 PyCharm 中运行我的代码时,from PyQt5 import QtWidgets, QtCore, QtGui... 出现错误 ModuleNotFoundError: No module named 'PyQt5'我在另一个地方看到了同样的问题:ImportError: No module named PytQt5但是这有点不同,因为我既没有使用 Ubuntu 也没有使用bash.我需要打扰我的 IT 人员让他帮我修改吗PYTHONPATH?(我认为这需要管理员权限)。如果是这样,我应该怎么做?或者有没有办法从我的代码中将 PyCharm 定向到 PyQt5 的位置?
1 回答

慕盖茨4494581
TA贡献1850条经验 获得超11个赞
起初我没有意识到,但这个问题实际上是关于 PyCharm 包的。
解决方案:
PyCharm > 文件 > 设置
项目>点击
+
添加包输入 PyQt5
确保您的代理设置正确(我的一开始不是)。现在它正在工作。如果您需要代理:
PyCharm > 文件 > 设置
版本控制 > Subversion > 网络 > 导航到一般代理设置
检查
automatic
或manual
并填写详细信息 > 确定
添加回答
举报
0/150
提交
取消