Re: [問題] matplotlib.pyplot.show() 沒有東西

看板Python作者 (阿真)時間13年前 (2012/06/11 17:48), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串2/2 (看更多)
前文吃光

06/04 14:47,
我不是用IDE 我是直接呼叫python test.py
06/04 14:47

06/04 14:48,
只是這樣不知道為什麼沒辦法show出圖出來
06/04 14:48

06/04 21:17,
是用Windows 還是linux?
06/04 21:17

06/05 11:49,
Ubuntu 10.04
06/05 11:49
我用ubuntu 10.04 灌matplotlib發現沒灌numpy 灌numpy用網路下載1.6.2的tar.gz sudo python setup.py install 雖然紅字一堆 但可以裝完 就沒理它 然後灌matplotlib用 sudo easy_install -m matplotlib (若沒easy_install也要先裝) 可是裝完他最後它跟我說 Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("matplotlib") # latest installed version pkg_resources.require("matplotlib==1.1.0") # this exact version pkg_resources.require("matplotlib>=1.1.0") # this version or higher 所以我把程式碼改成如下圖所示 結果也可以跑如下圖所示 https://dl.dropbox.com/u/24628527/ubuntu_matplotlib_test.PNG
以上 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.63.202

06/12 12:57, , 1F
如果舊版OK,可sudo apt-get install python-matplotlib
06/12 12:57, 1F

06/12 12:58, , 2F
和 install python-numpy
06/12 12:58, 2F
文章代碼(AID): #1FrRxV00 (Python)
討論串 (同標題文章)
文章代碼(AID): #1FrRxV00 (Python)