码迷,mamicode.com
首页 > 编程语言 > 详细

python安装插件包注意事项

时间:2017-03-09 13:16:35      阅读:604      评论:0      收藏:0      [点我收藏+]

标签:解决办法   安装   成功   没有   版本   port   form   文件名   www   

注意!注意!注意!
安装以来lib库时强烈建议使用pip安装:
原因:
nu1:用exe安装会出现各种意想不到让您惊讶的错误!!!
nu2:这种错误很难解决且花费无用功!!!

使用pip安装:

nu1:使用.whl文件(Python库路径 http://www.lfd.uci.edu/~gohlke/pythonlibs/),如pip install xxx.whl

nu2:直接装 pip install xxx,如pip install xlwt(安装xlwt插件库)

安装过程中遇到的问题:

nu1:XXX is not a supported wheel on this platform,解决办法:进入python命令行界面输入import pip; print(pip.pep425tags.get_supported())可以获取到pip支持的文件名还有版本
如:安装 pip install numpy-1.10.4+mkl-cp27-cp27m-win32.whl 报错
>>import pip; print(pip.pep425tags.get_supported())
[(‘cp27‘, ‘none‘, ‘win32‘), (‘py2‘, ‘none‘, ‘win32‘), (‘cp27‘, ‘none‘, ‘any‘), (‘cp2‘, ‘none‘, ‘any‘), (‘cp26‘, ‘none‘, ‘any‘), (‘cp25‘, ‘none‘, ‘any‘), (‘cp24‘, ‘none‘, ‘any‘), (‘cp23‘, ‘none‘, ‘any‘), (‘cp22‘, ‘none‘, ‘any‘), (‘cp21‘, ‘none‘, ‘any‘), (‘cp20‘, ‘none‘, ‘any‘), (‘py27‘, ‘none‘, ‘any‘), (‘py2‘, ‘none‘, ‘any‘), (‘py26‘, ‘none‘, ‘any‘), (‘py25‘, ‘none‘, ‘any‘), (‘py24‘, ‘none‘, ‘any‘), (‘py23‘, ‘none‘, ‘any‘), (‘py22‘, ‘none‘, ‘any‘), (‘py21‘, ‘none‘, ‘any‘), (‘py20‘, ‘none‘, ‘any‘)]
通过这里可以发现上面下载的文件名格式是不支持的,修改为:numpy-1.10.4+mkl-cp27-none-win32.whl即可成功安装。

nu2:注意库之间的依赖安装循序
如numpy 和 matplotlib ,装matplotlib需要依赖numpy,因此要先装numpy再装matplotlib

nu3:注意库版的py版本号要与python好保持一致
如umpy-1.10.4+mkl-cp27-none-win32.whl ,cp27代表python2.7版本

检查插件库是否正确安装:

nu1:进入python命令行 直接执行 improt XXX(插件名)如import numpy 没有报错或者任何提示说明安装成功

 

python安装插件包注意事项

标签:解决办法   安装   成功   没有   版本   port   form   文件名   www   

原文地址:http://www.cnblogs.com/nzg-noway/p/6525094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!