python Matplotlib的安装
来源:互联网 发布:汽车车牌数据平台 编辑:程序博客网 时间:2024/05/18 00:23
因为自己要用到python来分析数据并绘制图片,再把图片以其他的监控内容用python发邮件,本人很少用到python,所在绘图的工具就选择了网上大家都推荐的
Matplotlib,然后按照网上的数篇教程进行安装,各种失败,回顾下网上的一些帖子也都是照抄一个出处的,其实安装流程官网介绍的很清楚,这里总结一下:
以python2.7为例安装:所有的安装程序都可以在网站找到
http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
其实很简单的,不要去看网上的那些帖子,照着官网的指引安装即可,后面我会说明下网上帖子的一些蛋疼地方:
Matplotlib is a 2D plotting library.
Requires numpy, dateutil, pytz, pyparsing, six, setuptools, and optionally pillow, pycairo, tornado, wxpython, pyside, pyqt4, ghostscript, miktex, ffmpeg, mencoder, avconv, or imagemagick.
这段话就是官网的安装指引,所需的必须库numpy, dateutil, pytz, pyparsing, six, setuptools,我已经安装下来了,依次安装就好了。
若提示找不到pyhton2.7的注册表项,则运行一下附录的redister_python.py脚本,然后依次安装即可。
过程的一些回顾;
1、帖子全部让安装scipy,然后把其目录下的six.py拷贝到python的C:\Python27\Lib\site-packages目录下。官网明确告诉你了只依赖six库,帖子偏要去安装一个超集然后自己手动拷贝子集(当然,不排除是很早以前的版本需要scipy)。
2、python最好是用官方版本的,不要用其他的,例如我用的google chromium项目里面的python27,结果他删除了很多标准库,而导致import问题
3、安装的时候提示找不到python,一般安装的官网的python都没这个问题,如果是拷贝的python过来那么可能会缺少注册表,运行下面的脚本自己注册key;
import sys
from _winreg import *
# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix
regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
)
def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print "*** Unable to register!"
return
print "--- Python", version, "is now registered!"
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print "=== Python", version, "is already registered!"
return
CloseKey(reg)
print "*** Unable to register!"
print "*** You probably have another Python installation!"
if __name__ == "__main__":
RegisterPy()
- python Matplotlib的安装
- python matplotlib的安装
- Python绘图工具matplotlib的安装
- python matplotlib 安装碰到的问题
- python---matplotlib安装、networkx的使用
- python中安装matplotlib的问题
- windows下Python matplotlib的安装
- centos 安装python的PIL matplotlib模块
- 【Python】win10下tensorflow、matplotlib的安装
- 安装Python的画图工具matplotlib
- Python学习之matplotlib的安装
- 安装python Matplotlib 库
- python+numpy+matplotlib安装
- python numpy+matplotlib安装
- Python安装pandas,matplotlib
- 1-Python 安装 Matplotlib
- python中安装matplotlib
- python 安装matplotlib 模块
- [状压dp] hdu 4064 Carcassonne
- 开始为期一年的奋斗
- (一) Android WebView是什么?
- 第八周项目-求每周工资
- 第8周项目2:加班费,要不要?
- python Matplotlib的安装
- 第一三项是简单的
- Oralce 常用函数decode,SUBSTRING
- 第8周项目6 本月有几天?
- 11g RAC修改归档模式
- Vigenère Cipher 维吉尼亚加解密算法
- 第八周项目一计算函数值
- 读经典之TCPL练习一
- EasyPR--开发详解(2)车牌定位