环境: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
1. 下载网址:https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.5.1/
选择matplotlib-1.5.1.tar.gz
2. 解压后,cd到该文件夹中。而后输入
python setup.py build
sudo python setup.py install
等待安装完成。
在Ubuntu 14.04环境下,使用python2.7运行matplotlib demo时遇到AttributeError,由于系统自带matplotlib版本为1.3.1,不支持wrap属性。参考Stack Overflow解答,了解到问题在于matplotlib版本低于1.5。通过手动下载并安装matplotlib 1.5.1解决此问题,详细步骤包括下载源码、解压、运行build和install命令。
2914

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



