ubuntu16 安装matplotlib
在安装ubuntu安装matplotlib时碰到不少问题,简单做个备忘:
需要先安装其依赖的包libpng和freetype
安装libpng:
sudo apt-get install libpng-dev
安装freetype:
cd ~/Downloads
wget https://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz
tar zxvf freetype-2.4.10.tar.gz
cd freetype-2.4.10/
./congfigure
make
sudo make install
安装pip,然后通过pip来安装matplotlib:
sudo apt-get install python-pip
安装好pip后就可以用下面的命令来查找matplotlib和查看其安装状态
sudo pip search matplotlib
安装matplotlib
sudo pip install matplotlib
1.no module named configparser
pip install configparser
或 sudo aptitude install python-configparser
出现这个问题的原因是python3中并没有ConfigParser这个模块,为了遵循pep 8的标准,已经改名为configparser了。
通过报错可以看到出问题的文件在哪里,我们切换到该文件所在文件夹,我的是/usr/bin/。如果通过一般的思维,即把该文件中的语法转化为python3,那么可以解决这个问题,但是又会报出其它错误,可以照错误提示一直把全部相关文件和模块改为python3的语法,但是工作量很繁琐。
另外一种方法:通过ls我们可以看到有个文件叫做pycompile,还有个文件叫做py3compile,前者遵循的是python2的语法,而我们使用pip的时候使用的就是pycompile,我们只需要用py3compile中的内容覆盖pycompile中的内容,这样的话就解决这个问题了
备注:以上是我在使用ubuntu16.04安装和使用pip发现的问题,ubuntu16.04测试成功
2. fatal error: Python.h: No such file or directory
For Python version 2.x+
$ sudo apt-get install python-dev
OR
# apt-get install python-dev
For Python version 3.x+
$ sudo apt-get install python3-dev
OR
# apt-get install python3-dev
注意在实际画图中仍然可能出错,错误是“NotImplementedError: Surface.create_for_data: Not Implemented yet.”
可以通过安装cairocffi解决。
sudo pip3 install cairocffi。
安装cairocffi也会碰到错误,可以尝试:
sudo apt-get install python3-dev
sudo apt-get install libffi-dev
sudo pip3 install cffi
sudo pip3 install cairocffi
或
pip install cairocffi==0.6
ubuntu16 安装matplotlib的更多相关文章
- Ubuntu 安装 matplotlib
参考: ubuntu16 安装matplotlib Ubuntu 安装 matplotlib sudo apt-get install libpng-dev libfreetype6-dev pkg- ...
- ubuntu安装matplotlib一些坑
ubuntu16.04,python2.7 安装matplotlib, 1.在root权限下执行命令 pip install matplotlib==1.5.1 这里有个困扰我一个星期的问题,系统都被 ...
- uwsgi+flask环境中安装matplotlib
uwsgi+flask的python有自身的virtual environment,可以通过如下命令进入 . venv/bin/activate 虽然通过sudo apt-get install py ...
- Python 安装matplotlib,six,dateutil,pyparsing 完整过程
[摘要:正在做词频剖析的时间,须要用matlotlib 做图表,柱状图啥的,因而便最先了一个又一个的装置库的进程 由于matplotlib 须要依附很多其他科教盘算的第三圆库,须要一个一个的装置了.. ...
- Ubuntu10.04 python2.6下安装matplotlib环境
一.准备工作1.sudo apt-get install python-numpy2.sudo apt-get install python2.6-dev3.sudo apt-get install ...
- 为python安装matplotlib模块
matplotlib是python中强大的画图模块. 首先确保已经安装python,然后用pip来安装matplotlib模块. 进入到cmd窗口下,执行python -m pip install - ...
- Python3.x(windows系统)安装matplotlib库
Python3.x(windows系统)安装matplotlib库 cmd命令: pip install matplotlib 执行结果:
- 安装matplotlib
1.1 Linux中安装matplotlib 如果使用的系统自带的python版本,可使用系统的包管理器安装matplotlib,命令如下: $ sudo apt-get install python ...
- 在tensorflow环境下安装matplotlib
在运行程序时,报错ImportError: No module named 'matplotlib',如图.经网上查询发现是没有安装matplotlib 因此记录一下在tensorflow环境下安装m ...
随机推荐
- ajax参考增删改查
AJAX做增删改查详细! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...
- CentOS安装JDK9
1.使用XShell将下载好的jdk-9.0.1_linux-x64_bin.tar.gz包上传到/opt/下 2.解压文件 $ tar -zxvf jdk-9.0.1_linux-x64_bin.t ...
- 微软Power BI 每月功能更新系列——4月Power BI 新功能学习
本月Power BI Desktop的更新,除了常规的视觉和数据连接器改进之外,还有两个非常大的功能改进,交互式的报表.问答,用户直接在Desktop可以询问有关的数据问题,面对层出不穷的用户需求,这 ...
- C 语言经典面试题 —— 宏
1. 运算符优先级与括号 #define Cube(a) a*a*a 无法解决 Cube(1+1) ⇒ 1+1*1+1*1+1 ⇒ 4,期待的应当是 8,故将其改造为 #define Cube(a) ...
- 20165228 学习基础和C语言基础调查
========== 做中学读后感 我依然认为兴趣与自觉性是推动一个人进步的两大因素,他们之间的区别是"兴趣"带来的影响更多是主动性的学习,而"自觉"则是略显被 ...
- mysql时间日期函数总结(转)
DAYOFWEEK(date) 返回日期date是星期几(1=星期天,2=星期一,……7=星期六,ODBC标准)mysql> select DAYOFWEEK('1998-02-03'); ...
- JavaBasic_07
面向对象三大特征 1.封装 封装是一种信息隐藏技术 a.是指数据和基于数据的操作封装在一起,数据被保护在内部(类的内部(对象)) b.系统的其他部分只有通过在数据外面的被授权的操作才能进行交互(没有授 ...
- 安装Ubuntu16.04与windows10双系统后,如何修改启动默认设置
在安装了Ubuntu16.04系统之后,系统会默认自启动Ubuntu16.04,而我们大多数情况下可能都在使用windows系统,不修改默认设置,不经意间便会启动了Ubuntu16.04,通过我的经历 ...
- java-抽象类的特点
1.抽象类和抽象方法必须用abstract关键字修饰. - abstract class 类名() - public abstract void eat(); 2.抽象类不一定有抽象方法,有抽象方法的 ...
- 《DSP using MATLAB》Problem 5.17
1.代码 %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% ...