(1)测试程序

    这是我从网上(http://www.open-open.com/lib/view/open1393488232380.html)找到的一个使用Numpy和matplotlib的示例程序,我用这段代码来测试Numpy和matplotlib安装是否成功。

import numpy as np
import matplotlib.pyplot as plt N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2) ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd) womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd) # add some
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width)
ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5') ) ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') ) def autolabel(rects):
# attach some text labels
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
ha='center', va='bottom') autolabel(rects1)
autolabel(rects2) plt.show()

(2)在Windows上安装

    在Windows上安装Numpy和matplotlib是一个和痛苦的过程。总体来说,安装这两个包的官方安装程序是远远不够的。总会提示你缺这个缺那个。我的解决办法接单粗暴,提示缺少什么了我就谷歌然后安装这个包。所有的包都可以从这个网站(http://www.lfd.uci.edu/~gohlke/pythonlibs/)找得到。

     最后为了安装Nump和matplotlib,我一共安装了6个包:

  • matplotlib-1.4.2.win-amd64-py2.7
  • numpy-MKL-1.9.1.win-amd64-py2.7
  • pyparsing-2.0.3.win-amd64-py2.7
  • python-dateutil-2.2.win-amd64-py2.7
  • scipy-0.15.0b1.win-amd64-py2.7
  • six-1.8.0.win-amd64-py2.7

(3)在Ubuntu上安装

    相比在Windows上安装软件,在Ubuntu上安装就简单多了,一句命令搞定:

   1: sudo apt-get install python-numpy python-matplotlib

    所有依赖的包都自动安装上了,给个赞!

    真心说一句,Ubuntu除了网络问题不给力之外,装软件真心是很赞的!

安装Numpy和matplotlib的更多相关文章

  1. win7系统下python安装numpy,matplotlib,scipy和scikit-learn

    1.安装numpy,matplotlib,scipy和scikit-learn win7系统下直接采用pip或者下载源文件进行安装numpy,matplotlib,scipy时会遇到各种问题,这是因为 ...

  2. ubuntu下安装numpy和matplotlib

    安装NumPy函数库--sudo apt-get install python-numpy 以及  sudo apt-get install python-scipy NumPy函数库的函数查看:Nu ...

  3. win7 64+python2.7.12安装numpy+scipy+matplotlib+scikit-learn

    python包下载网址 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 1.已经安装python2.7.12,查看scripts里是否有pip.2.7.9版本以上 ...

  4. 在Ubuntu 14.04 64bit上安装numpy和matplotlib库

    原文:http://blog.csdn.net/tao_627/article/details/44004541 按照这个成功安装! 机器学习是数据挖掘的一种实现形式,在学习<机器学习实战> ...

  5. Linux入门(10)——Ubuntu16.04使用pip3和pip安装numpy,scipy,matplotlib等第三方库

    安装Python3第三方库numpy,scipy,matplotlib: sudo apt install python3-pip pip3 install numpy pip3 install sc ...

  6. Python安装Numpy,matplotlib库

    <1> Numpy是一款基于python的功能强大的科学计算包.要安装numpy首先你得先安装python. python的安装非常简单,本人安装的是python2.7 具体安装步骤如下: ...

  7. Python 安装 numpy 以及 matplotlib 的过程

    系统:ubuntu 16.04 版本:Python3.5 步骤: 安装 pip sudo apt install python3-pip 查看 pip list 是否有 numpy 以及 matplo ...

  8. mac安装numpy,scipy,matplotlib

      SaintKings-Mac-mini:~ saintking$ python Python ( , ::) [GCC Compatible Apple LLVM (clang-)] on dar ...

  9. 安装numpy、matplotlib

    一.安装numpy 1.下载 https://pypi.org/project/numpy/#files 2.安装 pip3 install numpy-1.17.3-cp37-cp37m-win_a ...

随机推荐

  1. HW6.27

    import java.util.Scanner; import java.util.Arrays; public class Solution { public static void main(S ...

  2. Vmware Ubuntu 虚拟机下Android开发环境搭建

    概况: 1.安装jdk: 2.安装adt-bundle: 1.安装jdk 先下载linux下的jdk,我下的是 jdk-7u13-linux-i586 :然后解压,为方便,建个文件夹--/home/x ...

  3. ubuntukylin提取root权限及mongoDB部署

    UbuntuKylin下安装Mongodb (参照UbuntuKylin下安装Mongodb一文安装成功后的心得) 1.官网下载安装包  http://www.mongodb.org/dr/fastd ...

  4. [OC Foundation框架 - 19] 练习遇到的Bugs

    1.没有权限读取文件夹 The file “Homework2” couldn’t be opened because you don’t have permission to view it.   ...

  5. PTA 5-14 电话聊天狂人 (25分)

    给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人. 输入格式: 输入首先给出正整数NN(\le 10^5≤10​5​​),为通话记录条数.随后NN行,每行给出一条通话记录.简单起见,这里只列出 ...

  6. Win7 U盘安装Ubuntu16.04 双系统

    Win7系统下安装Ubuntu系统,主要分为三步: 第1步:制作U盘启动盘 第2步:安装Ubuntu系统 第3步:创建启动系统引导 第1步:制作U盘启动盘 1.下载Ubuntu16.04安装镜像,官网 ...

  7. 委托学习续:Action、Func和Predicate

    我们先看一个上一章的委托的例子: using System; using System.Collections.Generic; using System.Linq; using System.Tex ...

  8. [转] C++ Redistributable Package版本详解

    我们使用的程序常常都需要C++ Redistributable Package的支持.C++ Redistributable Package有众多版本,给安装带了不便. 目前(2013-12-04) ...

  9. Qt 经典出错信息之”Basic XLib functionality test failed!”(Z..z..)

    此完整出错信息是在./configure阶段 Basic XLib functionality test failed! You might need to modify the include an ...

  10. AFNetworking2.x 使用过程中遇到的问题

    1.//以下写一下关于AFNetworking2.0的GET数据请求问题,刚開始的时候没有写以下标红的代码,所以导致有一个问题.错误显演示样例如以下: Error: Error Domain=AFNe ...