(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. HDFS体系结构:(Distributed File System)

    分布式系统的大概图 服务器越来越多,客户端对服务器的管理就会越来越复杂,客户端如果是我们用户,就要去记住大量的ip. 对用户而言访问透明的就是分布式文件系统. 分布式文件系统最大的特点:数据存储在多台 ...

  2. AIDL:Binder invocation to an incorrect interface

    Android进程之间通信异常:主要原因是客户端的aidl文件和与远程调用的Service的aidl文件包名不同 处理方式一般就是在客户端要一个与远程暴露出来的接口包名要一致  服务端: 客户端:

  3. delphi -- 进制转换 函数表

    1.16 TO 10 ******************************************************** 16转10,否则输出-1 function Hex(c: cha ...

  4. nyoj 129 树的判定

    并查集+欧拉 树的判定 时间限制:1000 ms  |  内存限制:65535 KB 难度:4   描述 A tree is a well-known data structure that is e ...

  5. C/C++中的变量作用域

    #include <iostream> using namespace std; int i = 1;int j = 2; int main(){     int i = 9;  //C/ ...

  6. squid 安装、配置、优化

    官方网站:http://www.squid-cache.org 下载路径:wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABL ...

  7. nape.dynamics.InteractionFilter

    (转载http://tomyail.com/blog/1123) Nape定义了三种交互方式: Collision(碰撞) Sensor(感应) Fluid(浮力) 默认情况下两个物体只会发生Coll ...

  8. zookeeper配置同步zookeeper编程

    分布式助手Zookeeper(四) kissyoudyb 2013-12-05 17:41 阅读:33 评论:0     分布式助手Zookeeper(三) kissyoudyb 2013-12-05 ...

  9. Google maps API开发(一)(转)

    一.加载Google maps API <script type="text/javascript" src="http://ditu.google.com/map ...

  10. ATF批量导出工具

    ATF批量导出工具 08 / 31, 2013 批量导出Atf的工具,使用是adobe atf 编码核心 先说一下关于atf的bug 当atf导出时候启用了mips选项会导致:如果纹理问长方形时上传会 ...