pyecharts为什么会报 No module named 'pyecharts.components'的错误?
ModuleNotFoundError: No module named 'pyecharts.components' 为什么会出现这个错误?
标准样例代码
from pyecharts.components import Tabletable = Table()
headers = ["City name", "Area", "Population", "Annual Rainfall"]
rows = [
["Brisbane", 5905, 1857594, 1146.4],
["Adelaide", 1295, 1158259, 600.5],
["Darwin", 112, 120900, 1714.7],
["Hobart", 1357, 205556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Perth", 5386, 1554769, 869.4],
]
table.add(headers, rows)
table.render('test.html')
pip list看到已经安装pyecharts库
from pyecharts.charts import Bar也是错误
回答:
pip install pyecharts==1.9就好了
以上是 pyecharts为什么会报 No module named 'pyecharts.components'的错误? 的全部内容, 来源链接: utcz.com/p/937977.html