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 ...
随机推荐
- Mysql数据库文件迁移并修改默认数据文件存储位置
环境: 1.两台Win10电脑 2.MySql5.6 过程: 1.原电脑停止MySql服务 2.复制C:\ProgramData\MySQL\MySQL Server 5.6\data文件夹到目标电脑 ...
- zookeeper在Dubbo中扮演了一个什么角色
作者:guxiangfly链接:https://www.zhihu.com/question/25070185/answer/188238271来源:知乎著作权归作者所有.商业转载请联系作者获得授权, ...
- 【转载】 深度强化学习处理cartpole为什么reward很难超过200?
原贴地址: https://www.zhihu.com/question/266493753 一直在看强化学习方面的内容,cartpole是最简单的入门实验环境,最原始的评判标准是连续100次epis ...
- Samsung_tiny4412(驱动笔记03)----字符设备驱动基本操作及调用流程
/*********************************************************************************** * * 字符设备驱动基本操作及 ...
- Oval框架如何校验枚举类型的一种思路
前言: Oval校验框架被广泛集成于各类接口参数校验中, 其方便的注解语法, 易读性和扩展性. 几乎成了java后端服务代码的标配. 有人会很疑惑, 都已经是枚举类型了, 还需要校验吗? 其实这边更确 ...
- 【CSP】最大的矩形
问题描述 试题编号: 201312-3 试题名称: 最大的矩形 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 在横轴上放了n个相邻的矩形,每个矩形的宽度是1,而第i(1 ≤ ...
- 微信导出群记录V2.0
作业链接:[https://edu.cnblogs.com/campus/nenu/SWE2017FALL/homework/1245] 一.序 啊,忘了作业!作业内容是将东北师范大学2017级软件工 ...
- linux cron计划任务、chkconfig 命令、systemd命令、unit 相关、target 相关
1.设置说明位置 : cat /etc/crontab # Example of job definition:# .---------------- minute (0 - 59)# | .---- ...
- Count the Sheep 思维题
Altough Skipping the class is happy, the new term still can drive luras anxious which is of course b ...
- LeetCode – Number of Islands II
A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand oper ...