總結步驟:
- 直接去下載 matplotlib.exe ,載點:https://sourceforge.net/projects/matplotlib/files/matplotlib/
- 之後步驟就看錯誤訊息,缺什麼裝什麼
- 缺少的模組就用 easy_install 載
- 無法 easy_install ,就先去載 setuptools
- 缺少 whl ,就去載,跟 numpy 裝法一樣
- dateutil 的 whl 檔,http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil
- 備註:此文章用到兩種 python 安裝方式,http://blog.163.com/yang_jianli/blog/static/161990006201162152724339/
直接去下載matplotlib.exe
此連結:https://sourceforge.net/projects/matplotlib/files/matplotlib/
載下來後在 python 裡輸入 import matplotlib 測試是否安裝好
第一次的錯誤是
"no module pyparsing"(沒截到圖)
在cmd中用easy _install來安裝
如果你的easy_install不行,你可以去安裝 setuptools ,
去 python 官網找怎麼安裝 setuptools
官網上說 python2 在 2.7.9 以上,和 python3 在 3.4 以上安裝 python 的時候他就有包含 setuptools,
我是3.5,因此我只需要更新一下我的 setuptools(因為我是先安裝setuptools,所以我也不知道我直接打easy_install的指令可不可以)
更新後再輸入一次 import matplotlib 測試是否安裝好
然後我就來打了一下文章,又在輸入一次import matplotlib 測試是否安裝好,我可能中間做了啥,但我忘了,
總之錯誤變成
繼續easy_install
擴展成功
然後我依舊缺少 cycler 模塊,我想說"ㄜ...不然我重啟電腦好了"
重啟完後,再測試一次
去下載 dateutil 的 whl 檔,http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil
我是載這個
然後就跟之前安裝 numpy 的方法一樣裝上去
成功後,顯示
再試一次 import matplotlib
沒有錯誤訊息,裝好了
參考:
http://blog.163.com/yang_jianli/blog/static/161990006201162152724339/
http://blog.csdn.net/daniel_ustc/article/details/9714163
http://stackoverflow.com/questions/18280436/importerror-matplotlib-requires-dateutil
http://stackoverflow.com/questions/30196585/matplotlib-import-error-no-module-named-path
https://github.com/hashdist/hashstack/issues/390