简体   繁体   English

无法在 PyCharm 上安装 PyQt5

[英]Cannot install PyQt5 on PyCharm

I get this error each time I try to install PyQt5 on PyCharm每次我尝试在 PyCharm 上安装 PyQt5 时都会收到此错误

错误

So I try running the executed command from the system terminal as suggested in the screenshot and get this.因此,我尝试按照屏幕截图中的建议从系统终端运行执行的命令并得到它。

zsh: command not found: pip

I use this this command instead我改用这个这个命令

python3 -m pip install PyQt5

and it shows as already installed它显示为已安装

However, in PyCharm, PyQt5 is still undetected.但是,在 PyCharm 中,仍然没有检测到 PyQt5。

enter the following code in your terminal在终端中输入以下代码

"pip install pyqt5 pyqt5-tools" “点安装 pyqt5 pyqt5-工具”

Test if pqyt5 is actually installed Create a new file, example.py, and enter the following code.测试是否真的安装了pqyt5 新建一个文件example.py,输入如下代码。

import sys    
from PyQt5 import QtWidgets, QtCore  

app = QtWidgets.QApplication(sys.argv)  
widget = QtWidgets.QWidget()  
widget.resize(400, 200)  
widget.setWindowTitle("This is PyQt Widget example")  
widget.show()        
exit(app.exec_()) 

Read this Article below I think it's very helpful that's is where i got my knowledge https://pythonpyqt.com/how-to-install-pyqt5-in-pycharm/阅读下面的这篇文章,我认为这对我很有帮助https://pythonpyqt.com/how-to-install-pyqt5-in-pycharm/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM