pyecharts離線使用說明


安裝

  1. 下載源碼 https://github.com/pyecharts/pyecharts 解壓縮。

  2. python setup.py install --prefix your_install_dir

    如果報jinja2、prettytable、simplejson 等庫不存在,需要先安裝依賴庫,或將這些庫加到$PYTHONPATH后再執行install。

離線使用

v1.0之后,pyecharts默認使用在線的js asset文件,如果沒聯網會導致生成html打開后是空白。離線使用需要指定為本地的assets路徑。

  1. 下載assets https://github.com/pyecharts/pyecharts-assets 解壓縮。

  2. 在腳本里指定asset為上述目錄

    from pyecharts.globals import CurrentConfig, OnlineHostType
    CurrentConfig.ONLINE_HOST = "/xx/pyecharts-assets-master/assets/"
    

Warning消除

version 1.8.0 更新之后控制台會出現 PendingDeprecationWarning 的提示,如需關閉,請在腳本加入如下代碼:

from pyecharts.globals import WarningType
WarningType.ShowWarning = False


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM