Python开发环境包含科学计算,需要安装NumPy, SciPy, Matplotlib。其中Matplotlib依赖于Python和NumPy。我们先安装NumPY和SciPy.  Matplotlib安装稍微复杂

1.首先确保你的apt-get可用。如果不可用 试着更新一下

sudo apt-get install

2.安装你的NumPy和SciPy.

apt-get install python-numpy
apt-get install python-scipy

3.安装你的Matplotlib

安装Matplotlib前需要先安装其依赖的包libpng和freetype
安装libpng:

sudo apt-get install libpng-dev

安装freetype:

首先需要从网上下载freetype文件:http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz

下载成功后可以选择安装地址(笔者安装在 /usr/local/freetype 下)

sudo mkdir /usr/local/freetype
sudo cp freetype-2.4..tar.gz /usr/local/freetype
sudo tar zxvf freetype-2.4..tar.gz
sudo cd freetype-2.4./
sudo ./congfigure
sudo make
sudo make install

如果在执行sudo mke install时出现错误

rm -f /usr/local/modules/freetype/include/freetype2/freetype/cache/*
rmdir /usr/local/modules/freetype/include/freetype2/freetype/cache
rm -f /usr/local/modules/freetype/include/freetype2/freetype/internal/*
rmdir /usr/local/modules/freetype/include/freetype2/freetype/internal
rmdir: ‘/usr/local/modules/freetype/include/freetype2/freetype/internal’: 没有那个文件或目录
make: [install错误 1 (忽略)
/usr/bin/install -c -m 644 ./builds/unix/ft2unix.h \
/usr/local/modules/freetype/include/ft2build.h
/usr/bin/install -c -m 644 ./builds/unix/ftconfig.h                        \
/usr/local/modules/freetype/include/freetype2/freetype/config/ftconfig.h
/usr/bin/install -c -m 644 /opt/src/lamp/freetype-2.2.1/objs/ftmodule.h                          \
/usr/local/modules/freetype/include/freetype2/freetype/config/ftmodule.h
/usr/bin/install -c -m 755 ./builds/unix/freetype-config \
/usr/local/modules/freetype/bin/freetype-config
/usr/bin/install -c -m 644 ./builds/unix/freetype2.m4 \
/usr/local/modules/freetype/share/aclocal/freetype2.m4
/usr/bin/install -c -m 644 ./builds/unix/freetype2.pc \
/usr/local/modules/freetype/lib/pkgconfig/freetype2.pc
注意上面的黑体字“rmdir: ‘/usr/local/modules/freetype/include/freetype2/freetype/internal’: 没有那个文件或目录 make: [install错误 1 (忽略)” (不同用户可能又不同路径)
解决方法:
sudo mkdir rmdir: /usr/local/modules/freetype/include/freetype2/freetype/internal

之后重新尝试sudo make install方法。

安装pip,然后通过pip来安装matplotlib:

sudo apt-get install python-pip

安装好pip后就可以用下面的命令来查找matplotlib和查看其安装状态

sudo pip search matplotlib

安装matplotlib

sudo pip install matplotlib

OK现在来检验一下

eric@eric-Lenovo-Y50-:~$ python
Python 2.7. (default, Jun , ::)
[GCC 4.8.] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import *
>>> random.rand(,)
array([[ 0.9615149 , 0.8125032 , 0.39732582, 0.31623145],
[ 0.72705913, 0.58407689, 0.81894134, 0.78653881],
[ 0.20863496, 0.08460187, 0.35620451, 0.49642794],
[ 0.34755404, 0.366561 , 0.2603963 , 0.85014281]])
>>> exit()
eric@eric-Lenovo-Y50-:~$

注意random.ran(4,4)为随机生成一个4×4数组,数组元素为随机数

Ubuntu下安装Numpy, SciPy and Matplotlib的更多相关文章

  1. Ubuntu Python 安装numpy SciPy、MatPlotLib环境

    安装 sudo apt-get install python-scipysudo apt-get install python-numpysudo apt-get install python-mat ...

  2. Windows10+Python3下安装NumPy+SciPy+Matplotlib

    Numpy.SciPy.MatplotLib是Python下从事科学计算必不可少的库.我在用其他的方法安装时出现各种问题,发现直接安装.whl包是最快且不报错的方法. 1.下载.whl包在下面的网站中 ...

  3. ubuntu下安装numpy和matplotlib

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

  4. Ubuntu下安装Python绘图库Matplotlib的方法

    在安装好Python的基础上, sudo apt-get install python-numpy sudo apt-get install python-scipy sudo apt-get ins ...

  5. ubuntu python 安装numpy,scipy.pandas.....

    http://blog.csdn.net/Yakumoyukarilan/article/details/51340358

  6. Ubuntu下安装python相关数据处理

    01. Ubuntu下安装ipython sudo apt-get install ipython 02. Ubuntu下安装pip $ sudo apt-get install python-pip ...

  7. windows下安装python科学计算环境,numpy scipy scikit ,matplotlib等

    安装matplotlib: pip install matplotlib 背景: 目的:要用Python下的DBSCAN聚类算法. scikit-learn 是一个基于SciPy和Numpy的开源机器 ...

  8. Windows系统在Python2.7环境下安装numpy, matplotlib, scipy - Lichanghao Blog

    numpy, matplotlib, scipy三个包是科学计算和绘图的利器.安装它们既可以在网上下载exe安装包,也可以用python内置的包管理工具来下载安装,后者较为方便. 这几天做美赛要用到, ...

  9. centos 7 下安装numpy、scipy等python包

    本文适用于刚入门的小白,欢迎大牛们批评指正. 因为要开始数据分析,而python又不像R和matlab那么简洁.需要安装的包很多~ 网上找了好多牛人博客,想在centos7下安装numpy,scipy ...

随机推荐

  1. 构造Json对象串工具类

    import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.Property ...

  2. VS2010 有关测试的一些使用

    Visual Studio 2010 单元测试之一---普通单元测试:http://blog.csdn.net/tjvictor/archive/2011/02/09/6175362.aspx   V ...

  3. Slate中绑定动态数据

    https://answers.unrealengine.com/questions/232322/slate-blurred-border-shadow.html

  4. [BZOJ3874][AHOI2014] 宅男计划

    Description 外卖店一共有N种食物,分别有1到N编号.第i种食物有固定的价钱Pi和保质期Si.第i种食物会在Si天后过期.JYY是不会吃过期食物的.比如JYY如果今天点了一份保质期为1天的食 ...

  5. 【听说是线段树】bzoj1012 [JSOI2008]最大数maxnumber

    一眼看题目吓了一跳:这TM不就是单调队列吗,200000又怎样,大不了我二分嘛 系统提示:成功开启 手残模式 开始瞎写: #include <cstdio> ]; ]; int m,mod ...

  6. Android底部菜单的实现

    前言:以前制作菜单使用TabHost,但是android 3.0以上就被废弃了,google已经不建议使这个类了.ActionBar也是菜单,不过在头部,算是导航了 ===本文就介绍怎么制作底部菜单= ...

  7. LinkedList实现队列和堆栈的代码

    package 集合; import java.util.LinkedList; /* *队列:先进先出 *把romovelast改成romoveFirst就成了堆栈 先进后出 *  * */publ ...

  8. 常见的HTTP Headers

    协议就是交互双方协商好要遵守的规范,打个不恰当的比方,就好像交谈双方约定要使用的同一种语言.如果我讲英文,你讲中文,大家都相互听不懂,交流那就得嗝屁了. HTTP协议就是需要交互的客户端(通常是浏览器 ...

  9. 关于ps中的锯齿

    1.1 索引透明颜色与Alpha透明通道   要说索引颜色透明,首先要讲讲什么是索引颜色,百度百科上有对索引颜色的解释,我觉得很关键的一句是“挑选一副图片中最有代表性的若干种颜色(通常不超过256种) ...

  10. php开发常见问题

    ajax 方面:   ajax写法:   //简写版ajax$.get('url.php',{'name':'myname','age':'18'},function(data){},'json'); ...