python使用pip安装SciPy、SymPy、matplotlib教程
背景:
使用pip install SciPy的格式安装python函数库SciPy的时候,发现老是报错,从网上找信息也没找到合适的解决办法,最后使用whl格式文件安装成功。
过程:
本人事先电脑安装了python3.5.2,电脑是64位的。
下载函数库:从网址http://www.lfd.uci.edu/~gohlke/pythonlibs/下载对应函数库的whl文件。注意下载对应的python版本和windows版本的whl文件,这里讲一下文件的规则:scipy‑0.19.1‑cp35‑cp35m‑win_amd64.whl,这里的cp35对应python版本号,win_amd64对应64位版本,前面0.19.1对应scipy的版本号。
由于我已经安装了numpy,只安装了下面的whl文件。
>>pip install E:\360安全浏览器下载\scipy-0.19.1-cp35-cp35m-win_amd64.whl
>>pip install E:\360安全浏览器下载\matplotlib-1.5.3-cp35-cp35m-win_amd64.whl
>>pip install E:\360安全浏览器下载\sympy-1.1.1-py2.py3-none-any.whl
注意:
下载的.whl文件不要重命名;
安装顺序有讲究,可以先装numpy、scipy模块后装matplotlib,因为各模块之间有相互依赖关系。
如果第一次安装不成功可以重新安装几次,matplotlib、scipy都是安装了两次才成功,
安装还是不成功的时候可以选择下载低版本的函数库试一下。
如果以上安装过程嫌麻烦,也可以直接安装已经集成了很多有用的第三方包的发行版anaconda,或者安装python(x,y)。
后续:
使用过程中的一些错误提示及解决办法:
下面两个报错信息是我使用from scipy.optimize import leastsq报出的。
报错:RuntimeError:module compiled against API version 0xb but this version of numpy is 0xa。网上的资料说是numpy 版本不对。
解决办法:
pip install numpy –upgrade pip install -U numpy
我用第二个成功将numpy从numpy-1.12.1升级到numpy-1.13.1。
报错:File "C:\Python\lib\site-packages\scipy\linalg\blas.py", line 155, in <module> from scipy.linalg import _fblas ImportError: DLL load failed: 找不到指定的模块。
numpy版本报错解决之后,继续报错,从网上找答案也没有好的解决办法,看大家的思路都是说numpy的安装有问题。
感觉还是numpy安装得有问题,所以手动安装numpy的whl:numpy-1.13.1+mkl-cp35-cp35m-win_amd64.whl。成功解决。
Numpy + MKL链接到英特尔®数学内核库,包括numpy必需的dll.
之间觉得还是安装python(x,y)来得方便,就找了python(x,y)的安装包,后来觉得800M太大了直接放弃,给一个网址:
http://www.jb51.net/article/ftp:/ftp.ntua.gr/pub/devel/pythonxy/
以上这篇python使用pip安装SciPy、SymPy、matplotlib教程就是小编分享给大家的全部内容了,希望能给大家一个参考
您可能感兴趣的文章:
- python使用pip安装SciPy、SymPy、matplotlib
- 【编程语言】Python 使用包管理工具pip安装模块numpy、scipy、matplotlib以及scikit-learn CentOS 7
- Ubuntu16.04使用pip3和pip安装numpy,scipy,matplotlib等第三方库
- windows环境下python2.7、pycharm、numpy_mkl、scipy、sklearn、Matplotlib、jupyter完整安装教程
- Ubuntu-Python2.7安装 scipy,numpy,matplotlib 和pip
- Python中的Numpy、SciPy、MatPlotLib安装教程
- python使用安装numpy、scipy、matplotlib等工具包
- python安装numpy&安装matplotlib& scipy的教程
- 在windows下python,pip,numpy,scipy,matplotlib的安装
- python知识(4)----Ubantu14.04 下pip安装Numpy,SciPy和MatplotLib
- Python 安装Numpy,Scipy,Matplotlib-pip+whl文件
- python使用pip安装各种库,如matplotlib
- Linux入门(10)——Ubuntu16.04使用pip3和pip安装numpy,scipy,matplotlib等第三方库
- python及相关模块库的安装教程,例如pygame,Numpy, Scipy, matplotlib和scikit-learn等模块sklearn库
- 在windows下python,pip,numpy,scipy,matplotlib的安装
- windows环境下python2.7、pycharm、numpy_mkl、scipy、sklearn、Matplotlib、jupyter完整安装教程
- Linux入门(10)——Ubuntu16.04使用pip3和pip安装numpy,scipy,matplotlib等第三方库
- 在windows下python,pip,numpy,scipy,matplotlib的安装
- 在windows下python,pip,numpy,scipy,matplotlib的安装 系统:win7(64bit)
- Linux使用pip3和pip安装numpy,scipy,matplotlib等第三方库