python pip install numpy_pip install numpy(python 2.7)失败,错误代码为1

1586010002-jmsa.png

I'm installing numpy through pip on python 2.7.9... I checked pip list, and it returns pip (1.5.6), setuptools (12.0.4). I'm running on Windows 7 64-bit, and I've tried both Python 32 and 64-bit versions.

pip install numpy ends with:

Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\jon\\appdata\\local\\temp\\pip_build_jon\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\jon\appdata\local\temp\pip-qnynnf-record\install-record.txt --single-version-externally-managed

--compile failed with error code 1 in c:\users\jon\appdata\local\temp\pip_build_jon\numpyStoring

debug log for failure in C:\Users\jon\pip\pip.log

When I checked stackoverflow for other posts about errorcode 1, their solutions were to make sure you have an up-to-date version of setuptools. I installed Python 2.7.9 from the main website, and it comes with both setuptools and pip ready to go. Plus I made sure my system had them installed by checking pip list.

So instead I looked up the debug log the console error told me to go to, at C:\Users\jon\pip\pip.log. It's quite lengthy, but near the end it says

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

I went to that url, downloaded the compiler, and ran pip install numpy again. It didn't throw errorcode 1 this time, but had a different issue. It printed a huge wall of text to the screen, which never happened the last time I installed numpy/matplotlib/etc. It printed the text for a few minutes, then froze and stopped.

I'm not sure how to proceed?

If it helps I can post the pip debug log.

解决方案

Download the wheel (.whl file) file from here and install with pip:

pip install wheel to install support for wheel files.

pip install numpy‑1.9.1+mkl‑cp27‑none‑win32.whl to install the wheel.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值