win7下安装Python +matplotlib
来源:互联网 发布:mac翻墙用什么软件好 编辑:程序博客网 时间:2024/05/16 07:55
终于安装好了Python +matplotlib特此记录下。感谢以下几个文字的作者给我的帮助,同时大家也可以参考这几个作者的方法:
1、http://www.open-open.com/lib/view/open1393488232380.html
2、http://blog.csdn.net/yang6464158/article/details/18546871#comments
3、http://blog.sina.com.cn/s/blog_6fb8aa0d0101qtt9.html
4、http://www.cnblogs.com/qianlifeng/archive/2012/02/13/2350086.html
5、http://jingyan.baidu.com/article/fdffd1f8390029f3e98ca102.html
同时附上安装程序下载的地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
一、安装python
首先先安装好python 因为3.X版本很多库不兼容,所以还是使用2.7的。python下载地址https://www.python.org/download/我用的是64位的。整体而言,整个安装过程,如果用64的包就所有的包都需要用64的,不然会有问题。
二、安装matplotlib(在安装的时候,如果出现Python version 2.7 required, which was not found in the registry这样的问题,请参见http://blog.csdn.net/bush2582/article/details/39928049)
安装matplotlib最好选择1.3.0.版本的,不然会出现一个ImportError: six 1.3 or later is required; you have 1.2.0这样的问题。 下载之后,点击安装即可。
三、安装dateutil,pyparsing,scipy
No module name six
在安装完毕scipy之后把C:\Python27\Lib\site-packages\scipy\lib中的six.py six.pyc six.pyo三个文件拷贝到C:\Python27\Lib\site-packages目录下。
四、安装NumPy
安装NumPy的时候需要特别注意,如果你前面的包都是64的请安装64位的NumPy不然会出现例如如下的错误:
Traceback (most recent call last):
File "D:\works\JetBrains\python\simplePref\test.py", line 5, in <module>
import matplotlib.pyplot as plt; plt.rcdefaults()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 156, in <module>
from matplotlib.cbook import is_string_like
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 28, in <module>
import numpy as np
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 153, in <module>
from . import add_newdocs
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
同时64的NumPy包的名字是numpy-MKL-1.8.1.win-amd64-py2.7.exe,请注意。
五、安装完毕测试
- 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()
- win7下安装Python +matplotlib
- win7下安装Python +matplotlib
- 【python】matplotlib在windows10 和win7下安装
- win7 64位 python安装 matplotlib
- windows下python安装matplotlib
- [Python]windows下安装matplotlib
- Windows下python安装matplotlib
- 在python下安装MatPlotLib
- python环境下安装matplotlib
- win7系统下Python、Numpy、NLTK、Matplotlib等的安装【python自然语言处理所需
- win7下安装matplotlib+six+pysparsing
- 在win7下安装python开发环境和numpy,scipy,matplotlib模块的问题
- win7下安装Python,numpy,matplotlib,scipy,scikit-learn等机器视觉工具包
- 在windows下python,pip,numpy,scipy,matplotlib的安装 系统:win7(64bit)
- win7+python+matplotlib
- win7下安装python
- win7下安装python
- win7 安装matplotlib
- 命令行关闭开启和删除驱动服务
- 信息安全属性CIA
- Android View坐标getLeft, getRight, getTop, getBottom
- POJ 3842 An Industrial Spy 快筛质数+STL乱搞
- Android File Transfer – 在 Mac 上也能读取 Android 设备文件
- win7下安装Python +matplotlib
- 安装Python-Matplotlib时出现的问题--Python version 2.7 required, which was not found in the registry
- ARM的存储器映射与存储器重映射
- 黑马程序员——基本常识,java的跨平台性,环境搭建,
- IOS多线程之——NSThread
- display:inline、block、inline-block的区别
- Centos 6.X版本配置VNC:
- Discount Louis Vuitton Bags 0OCDA
- Cheap Louis Vuitton Sunglasses 33fT8