使用Python 2.7.x在Windows 8.1上安装NumPy

时间:2021-02-05 20:23:07

I'm very new to Python and programming world and has been going along with tutorials from newcoder.io This Here! I have been doing as per the instructions but when I try to install NumPy I get an error.

我对Python和编程领域非常陌生,一直在学习newcoder的教程。io这这里!我已经按照说明做了,但是当我试图安装NumPy时,我得到一个错误。

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

错误:Microsoft Visual c++ 9.0是必需的(无法找到vcvarsall.bat)。从http://aka.ms/vcpython27得到它


Command "C:\Users\HP.virtualenvs\DataVizProj\Scripts\python.exe -c "import setuptools, tokenize;file='c:\users \appdata\local\temp\pip-build-lsj5sj\numpy\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).re .replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\hp\appdata\local\temp\pip-6jei4k-record\instal cord.txt --single-version-externally-managed --compile --install-headers C:\Users\HP.virtualenvs\DataVizProj\includ te\python2.7" failed with error code 1 in c:\users\hp\appdata\local\temp\pip-build-lsj5sj\numpy

用户命令“C:\ \ HP.virtualenvs \ DataVizProj \ \ python脚本。导入setuptools, tokenize;file='c:\用户appdata\本地\temp\pip-build-lsj5sj\numpy\setup.py';exec(compile, getattr, 'open', open)(file)。重新安装('\r\n', '\n')文件,'exec') "安装-记录c:用户\hp\appdata\本地\temp\pip \pip-6jei4k-record\txt - single-version-externally-managed—编译—install-headers C:\Users\HP.在c:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ - \ \ \ \ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"

But that's not enough, I tried to install VCForPython27.msi from the given link. But still, gets the same error.

但这还不够,我试图安装VCForPython27。来自给定链接的msi。但还是会有相同的错误。

Please Help!

请帮助!

2 个解决方案

#1


3  

I recommend installing the Anaconda distribution of Python. It contains more packages than you can dream of, including numpy of course: http://continuum.io/downloads

我建议安装Python的Anaconda分布。它包含的包比你想象的要多,当然包括numpy: http://continuum.io/downloads

The installation is as straightforward as installing the usual Python, no matter what OS you are on.

安装过程与安装常规的Python一样简单,无论您使用什么操作系统。

#2


2  

A good solution is to download the wheel file which match your Python version here:unofficial python binaries

一个好的解决方案是下载与您的Python版本匹配的wheel文件:非官方的Python二进制文件

And then go to the folder where the .whl file is present using the command prompt and unpack the wheel file xxxxx.whl with:

然后使用命令提示符进入.whl文件所在的文件夹,解压缩这个轮文件xxxxx。whl:

>python -m pip install xxxxx.whl

This will install the library in the Lib\site-packages folder, you can check it afterwards.

这将在Lib\site-packages文件夹中安装库,之后您可以查看它。

#1


3  

I recommend installing the Anaconda distribution of Python. It contains more packages than you can dream of, including numpy of course: http://continuum.io/downloads

我建议安装Python的Anaconda分布。它包含的包比你想象的要多,当然包括numpy: http://continuum.io/downloads

The installation is as straightforward as installing the usual Python, no matter what OS you are on.

安装过程与安装常规的Python一样简单,无论您使用什么操作系统。

#2


2  

A good solution is to download the wheel file which match your Python version here:unofficial python binaries

一个好的解决方案是下载与您的Python版本匹配的wheel文件:非官方的Python二进制文件

And then go to the folder where the .whl file is present using the command prompt and unpack the wheel file xxxxx.whl with:

然后使用命令提示符进入.whl文件所在的文件夹,解压缩这个轮文件xxxxx。whl:

>python -m pip install xxxxx.whl

This will install the library in the Lib\site-packages folder, you can check it afterwards.

这将在Lib\site-packages文件夹中安装库,之后您可以查看它。