python用pip安装numpy完整命令_使用Python的pip命令安装numpy

在Windows 8.1 32位系统上,使用Python 2.7.9安装numpy时遇到了编译错误。由于缺少预编译的二进制文件,pip尝试编译源代码,但因vcvarsall.bat缺失失败。通过修改distutils中的代码解决了RuntimeError,成功安装numpy。测试程序展示了chi2_distance函数的计算过程。
摘要由CSDN通过智能技术生成

NumPy 是一个基础科学的计算包。很多的科学计算特别是向量处理的时候会用到。

因为用到了,而且安装的过程中出现了一些问题,所以记录下来,便于备查。

平台: windows 8.1 64位

Python: 2.7.9 32位(已包含pip命令)

无Microsoft的VS环境

打开powershell,(事先将Python以及Python的Script的目录导入环境变量PATH中),输入

pip install numpy

会出现:

Unable to find vcvarsall.bat

的错误消息。

原因是:the Python package being installed contains the source code for a native extension module (.pyd), but does not have a pre-built copy of the module. The Python packages highlighted at pythonwheels.com have already been updated by their developers to include pre-built binaries, but many are still only available as source code.(来自微软官网)

我自己的理解是:要编译的代码中用到了C的代码,而这个包的代码发布的时候没有预先编译成Python的二进制文件,所以安装过程中需要使用C complier 编译这些模块。

安装成功之后,继续执行

pip install numpy出现了下列的错误:

RuntimeError: Broken toolchain: cannot link a si

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值