Windows下安装numpy,scipy和matplotlib的过程
我的配置python34 ,OS:win10 64位,IDE:pycharm
注意注意!如果你装的python是32位的,装numpy,scipy和matplotlib的时候也得是32位的,如果你的python是64位的,numpy和scipy以及matplotlib也得是64位的
但是64位的numpy和scipy比较难找,所以建议全部装成32位的,如果python是64位,但是numpy和scipy却是32位的,会在运行时出现问题。
错误是:ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
如果你找到了具体的解决方法,也希望你能告诉我。
直接win+R得到的控制台界面中,输入pip install numpy 显示如下错误
Error:Microsoft Visual C++ 10.0 is required (unable to find vcvarsall.bat )
但是我确实已经安装了VS2012
解决方法
在下面的网站上下载exe文件
numpy :http://sourceforge.net/projects/numpy/files/NumPy/1.8.1/
我的python是34的,但是系统是64位的,里面的安装包全部都是针对32位的
所以安装的时候会提示出现了问题
Version 3.4 required which was not found in the registry
解决上述问题的方法
http://blog.csdn.net/baikaishui525/article/details/9473251
按照上面的方法更改注册表,并重新尝试安装。
如图便安装好了numpy
同样的安装scipy也是上面的步骤
Exe文件点击即可安装
安装matplotlib比较麻烦一点
http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
我下载了一个.whl文件的包,注意下载的时候根据自己的系统,我的是python34 64位系统。
所以首先需要安装wheel
键入命令 Pip install wheel
接下来需要安装上述的文件,
Pip install matplotlib-1.5.1-cp34-none-win_amd64.whl
但是会提示
‘....whl’looks like a filename ,but the file dosen’t exist
这个时候可以把.whl文件放在C:/Python34/Scripts中
Pip install C:/Python34/Scripts/matplotlib-1.5.1-cp34-none-win_amd64.whl
即安装的时候使用全部的路径名
然后就成功过了
至此numpy scipy和matplotlib全部安装完毕
安装的时候,注意这三个模块的安装顺序,先安装numpy ,其次scipy最后matplotlib
以上涵盖了两种方法,装python第三方库