matplotlib安装
matplotlib主頁:http://matplotlib.org/index.html?
安裝文檔:http://matplotlib.org/users/installing.html?
?
安裝步驟:
1,安裝python,略,linux一般自帶2.4版本
2,安裝numpy:
①??? http://sourceforge.net/projects/numpy/files/NumPy/,我下載的是numpy-1.6.2.tar.gz
說明:Numpy的高版本對python是進行兼容的,也就是直接下載最新版就可以了
②??? tar –xf numpy-1.6.2.tar.gz
③??? cd numpy-1.6.2
④??? python setup.py build
⑤??? python setup.py install
說明:此步一般不會出問題,注意此處完成后,可以驗證
不報錯,說明安裝正確
3,安裝libpng
①?? 下載libpng-1.2.50.tar.gz
②?? tar –xf libpng-1.2.50.tar.gz
③?? cd libpng-1.2.50
④?? ./configure
⑤?? Make install
4,安裝matplotlib
①?? http://sourceforge.net/projects/matplotlib/files/matplotlib/,下載matplotlib-1.1.1_notests.tar.gz
說明:matplotlib同樣是高版本對低版本的python進行兼容,所以直接下載最新版本
②??? tar –xf matplotlib-1.1.1_notests.tar.gz
③??? ?cd matplotlib-1.1.1_notests
④??? python setup.py build
⑤??? python setup.py install
說明,此步我出現了問題,由于開發機器上存在libpng,并且有多個版本,所以我在安裝時,跳過了libphg的安裝,報錯如下:
/usr/bin/ld: /usr/local/lib/libpng12.a(libpng12_la-png.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpng12.a: could not read symbols: Bad value
說明在加載libpng12.a符號時出錯,
解決辦法是:
mv /usr/local/lib/libpng12.a /usr/local/lib/libpng12.a_
或者刪除libpng重裝
?
完成以上步驟,驗證
即可在目錄下看到test.png的圖片。
?
?
轉載于:https://www.cnblogs.com/ouzi/archive/2012/09/29/2708442.html
總結
以上是生活随笔為你收集整理的matplotlib安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 快速构建Windows 8风格应用14-
- 下一篇: [读书] Computer Vision