作者KSJ (阿真)
看板Python
标题Re: [问题] matplotlib.pyplot.show() 没有东西
时间Mon Jun 11 17:48:12 2012
前文吃光
1F:→ Arim:我不是用IDE 我是直接呼叫python test.py 06/04 14:47
2F:→ Arim:只是这样不知道为什麽没办法show出图出来 06/04 14:48
3F:→ KSJ:是用Windows 还是linux? 06/04 21:17
4F:→ Arim: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
5F:推 popmentos:如果旧版OK,可sudo apt-get install python-matplotlib 06/12 12:57
6F:→ popmentos:和 install python-numpy 06/12 12:58