【发布时间】:2020-07-27 12:06:45
【问题描述】:
from PyQt5.QtChart import QChart, QChartView
我收到此错误:
«ModuleNotFoundError: No module named 'PyQt5.QtChart'»
根据答案,Cannot import PyQtChart in Python 3.7 完成了建议:
python -m pip install PyQt5==5.14 PyQtChart==5.14
和:
C:\P>pip3 search PyQt5
PyQt5-sip (12.7.2) - The sip module support for PyQt5
INSTALLED: 12.7.2 (latest)
PyQt5 (5.14.2) - Python bindings for the Qt cross platform application toolkit
INSTALLED: 5.14.0
LATEST: 5.14.2
C:\P>pip3 search PyQtChart
PyQtChart (5.14.0) - Python bindings for the Qt Charts library
INSTALLED: 5.14.0 (latest)
QCharted (1.1.1) - Plotting large data series using PyQtChart.
版本相同5.14.0(PyQt5)和5.14.0(PyQtChart),但出现«ModuleNotFoundError: No module named 'PyQt5.QtChart'»的错误
所以,我想知道问题是什么?
【问题讨论】:
-
如何执行你的脚本?
-
*.py - PyCharm。在 cmd.exe 中安装。
-
你确定pycharm使用的是你安装pyqtchart的python吗?
-
是的,因为其他程序 *.py 和模块也可以工作(例如 reguests、Matplotlib、PyQt5 等)。仅在安装 PyQtChart 时出现问题。
-
嗯,这不是一个可靠的答案,我建议你检查jetbrains.com/help/pycharm/…
标签: python python-3.x pyqt5 pyqtchart