日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

pyecharts在jupyter notebook中使用报错

發布時間:2023/12/10 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 pyecharts在jupyter notebook中使用报错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

建議下載pyecharts(0.5.xx)版本,如果使用 pip install pyecharts 默認安裝V1版本(如1.7.1)會出現如下報錯:

1、Bar模塊導入問題
from pyecharts import Bar

報錯:cannot import name ‘Bar’
解決辦法

from pyecharts.charts import Bar
2、Bar 使用報錯
from pyecharts import Bar bar =Bar("我的第一個圖表", "這里是副標題") #標題 bar.add("服裝", #標簽["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"],#x坐標[5, 20, 36, 10, 75, 90]) #y坐標 # is_more_utils = True #顯示右側的工具欄 # bar.show_config() # 打印所有參數 bar.render('my_first_chart.html')#保存圖列 bar

報錯:TypeError: init() takes from 1 to 2 positional arguments but 3 were given
嘗試注釋掉報錯行:

#bar =Bar("我的第一個圖表", "這里是副標題")

還會有新的報錯:‘Bar’ object has no attribute ‘add’
解決辦法:卸載、安裝舊版本

pip install pyecharts==0.5.10 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn

如果安裝時報錯(mac系統):

Failed building wheel for dukpy xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunerror: command 'gcc' failed with exit status 1

解決辦法
1、安裝xcode

xcode-select --install

2、然后再安裝pyecharts-0.5.10

3、安裝成果后重啟jupyter notebook即可

另附幾個pyecharts教程,舊版pyecharts一樣強大:
Python可視化-Echarts
報表統計圖
金融數據可視化

總結

以上是生活随笔為你收集整理的pyecharts在jupyter notebook中使用报错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。