当我尝试在PyCharm中导入以下内容时:
import sys
from PyQt5.QtWidgets import QtGui, QtCore
编译时会生成此错误:
ImportError: No module named 'PyQt5'
我想在Pycharm中安装PyQt5。您能否详细解释一下我应该怎么做?
当我尝试在PyCharm中导入以下内容时:
import sys
from PyQt5.QtWidgets import QtGui, QtCore
编译时会生成此错误:
ImportError: No module named 'PyQt5'
我想在Pycharm中安装PyQt5。您能否详细解释一下我应该怎么做?
PyCharm -> file -> settings -> project:'your_project' - project interpreter -> + -> install PyQt5
在PyCharm中,使用pip install PyQt5无法正常工作。
from PyQt5 import QtCore, QtGui, QtWidgets
pip install PyQt5
安装PyQt5的原因是Python软件包索引(PyPi,即pip
搜索软件包的地方)未提供可供下载的文件。pip search
命令时,你会得到一个已在PyPi注册的项目列表,无论是否提供了可下载的源文件。pip
之外采取的步骤不会出现在你的requirements.txt
中。pip3 install pyqt5
sudo apt install pyqt4-dev-tools
sudo apt install pyqt5-dev-tools
pyqt5
pip3 install pyqt5
安装说明已经在这里完整描述。
从PyCharm打开终端(视图->工具窗口->终端),然后输入以下内容:
python -m pip install pyqt5