1.安装Pyecharts包
我用的是Win环境,首先打开命令行(win+R),输入:
pip install pyecharts
实测时发现,下载时会出现断线和速度过慢的问题导致下载失败,所以建议通过清华镜像来进行下载
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts==0.5.8
注意:这里最好使用0.5.x版本的,不然在绘画区县图时很容易显示不了对应的图片,经过测试发现的,具体原因还未搞清除
2.安装扩展地图
pip install echarts-countries-pypkg
pip install echarts-china-provinces-pypkg
pip install echarts-china-cities-pypkg
pip install echarts-china-counties-pypkg
pip install echarts-china-misc-pypkg
pip install echarts-united-kingdom-pypkg
安装过程同样如果出现很缓慢的过程,同样更换源,采用以下的代码
pip --default-timeout=100 install 库名称 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
其中库名即为上面的第三列
3.样例
from pyecharts

本文介绍了如何在Windows环境下安装Pyecharts库,并解决下载速度慢的问题,推荐使用清华镜像源。同时,详细列出了安装扩展地图模块的步骤,包括国家、省份、城市、区县等不同级别。最后给出了一个使用Pyecharts绘制贵阳地图的代码示例。

1480

被折叠的 条评论
为什么被折叠?



