使用pip安装numpy库问题汇总
来源:互联网 发布:免费收款收据软件 编辑:程序博客网 时间:2024/05/18 01:25
easy_install和pip都是用来下载安装Python一个公共资源库PyPI的相关资源包的管理工具,而pip是easy_install的改进版,提供更好的提示信息,删除package等功能。Python官网上编译好的msi文件已经包含这两个工具,安装在<Python安装目录>/lib/site-packages文件中。
系统环境是win7(64bit)+python2.7.10(64bit)+vs2010,在此记录使用pip安装numpy过程中出现的问题及解决方法。
1 Unable to find vcvarsall.bat
打开powershell,(事先将Python以及Python的Script的目录导入环境变量PATH中),输入:
pip install numpy
出现错误:
Setup script exited with error: Unable to findvcvarsall.bat
【原因分析】
Setupscript exited with error: Unable to find vcvarsall.batThePython package being installed contains the source code for a native extensionmodule (.pyd), but does not have a pre-built copy of the module. ThePython packages highlighted at pythonwheels.com have already been updated by theirdevelopers to include pre-built binaries, but many are still only available assource code.(来自微软官网)
即需要编译的代码中用到了C的代码,而这个包的代码发布的时候没有预先编译成Python的二进制文件,所以安装过程中需要使用C complier 编译这些模块。在Windows下,Python的setup.py需要Visual Studio2008的支持。
【解决方法】
(1)如果你的机器上有更高版本的VS,可以通过下面的方式让Python使用更新版本的VS来支持安装。
如果你的机器上装了VisualStudio 2010,可以在执行pip install之前先执行下面的命令:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
如果你安装了VisualStudio2012可以执行下面命令:
SET VS90COMNTOOLS=%VS110COMNTOOLS%
如果你装的vs版本是2013可以使用下面命令:
SET VS90COMNTOOLS=%VS120COMNTOOLS%
(2)如果没有Microsoft的VS环境,可以安装 Microsoft Visual C++ Compiler for Python 2.7 。
2 cannot link a simple C program
问题1排除后继续安装过程,出现错误:
RuntimeError: Broken toolchain: cannot link asimple C program
【解决方法】
在路径%PythonHome%Lib\distutils(默认是C:\Python27\Lib\distutils)中的msvc9compiler.py文件大约661行处,如下图修改:
重新输入命令
pip install numpy
安装成功:
【参考资料】
http://www.tuicool.com/articles/JzI3Uj
http://blog.csdn.net/yanqiangsdu/article/details/43166951
- 使用pip安装numpy库问题汇总
- 使用pip安装numpy遇到问题
- 使用pip 安装numpy
- PIP的使用:使用PIP安装numpy
- 使用Python的pip命令安装numpy
- win10下使用pip安装numpy
- 安装numpy、nltk问题汇总
- 安装numpy、nltk问题汇总
- 安装numpy、nltk问题汇总
- 解决win8使用pip安装numpy后无法使用
- 使用pip安装对应python版本的numpy包
- 安装 python/pip/numpy/matplotlib
- python pip numpy安装记录
- 安装 python/pip/numpy/matplotlib
- Python安装——64位win10安装pip,numpy,scipy遇到的问题和解决方案
- 解决使用pip安装lxml包报错问题
- 使用pip安装pygame遇到的问题
- Python安装numpy,matplotlib,scikit_learn遇到的问题大汇总
- struts2 入门
- Segments - POJ 3304 线段相交
- 开源ETL工具 Pentaho Kettle
- jdk动态代理(动态生成字节码与反射机制的结合)
- Product of Array Except Self
- 使用pip安装numpy库问题汇总
- 机器学习之径向基神经网络(RBF NN)
- 全排列和全组合实现
- 第三方登录(二)
- 塌下心来干一番事业
- 类与对象特征总结
- java连接MySQL(从驱动下载到测试)
- iOS动画中的物理知识应用之愤怒的小鸟-碰撞检测
- 受不了CSDN的蛋疼