1. 程式人生 > >matplotlib報錯:AttributeError: Unknown property wrap

matplotlib報錯:AttributeError: Unknown property wrap

環境:ubuntu14.04, python2.7

在執行demo時報錯:http://matplotlib.org/examples/text_labels_and_annotations/autowrap_demo.html

查詢到原因:http://stackoverflow.com/questions/34375618/the-use-of-kwarg-wrap-for-a-pyplot-text-artist-in-matplotlib

“You are not using 1.5 if the keyword is not working”

自己查了下版本:

>>> import  matplotlib
>>> matplotlib.__version__
'1.3.1'

果然版本太低

之前是用命令sudo apt-get install python-matplotlib來安裝的,查了下,發現ubuntu14.04的python-matplotlib包是1.3的,要到ubuntu16.04才升級到1.5

所以,只能手動安裝matplotlib

教程(未測試):http://www.cnblogs.com/darkknightzh/p/5681059.html