问题:使用Python 2.7.3在64位Windows 7上安装Numpy

看起来Numpy的唯一64位Windows安装程序适用于Numpy版本1.3.0,仅适用于Python 2.6

http://sourceforge.net/projects/numpy/files/NumPy/

我不得不回滚到Python 2.6才能在Windows上使用Numpy,这让我感到很奇怪,这让我觉得我缺少了一些东西。

是吗

It looks like the only 64 bit windows installer for Numpy is for Numpy version 1.3.0 which only works with Python 2.6

http://sourceforge.net/projects/numpy/files/NumPy/

It strikes me as strange that I would have to roll back to Python 2.6 to use Numpy on Windows, which makes me think I’m missing something.

Am I?


回答 0

在此站点中尝试(非官方)二进制文件:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

numpy无论有没有针对Python 2.7或Python 3的Intel MKL库,您都可以获取最新的x64。

Try the (unofficial) binaries in this site:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

You can get the newest numpy x64 with or without Intel MKL libs for Python 2.7 or Python 3.


回答 1

假设您的计算机上安装了python 2.7 64bit,并且已经从此处下载了numpy ,请按照以下步骤操作(numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl适当更改)。

  1. get-pip下载(通过右键单击并“保存目标”)到本地驱动器。

  2. 在命令提示,导航到包含目录get-pip.py和运行

    python get-pip.py

    这在创建的文件C:\Python27\Scripts,包括pip2pip2.7pip

  3. 将下载的文件复制numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl到上述目录(C:\Python27\Scripts

  4. 仍然在命令提示符下,导航到以上目录并运行:

    pip2.7.exe install "numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl"

Assuming you have python 2.7 64bit on your computer and have downloaded numpy from here, follow the steps below (changing numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl as appropriate).

  1. Download (by right click and “save target”) get-pip to local drive.

  2. At the command prompt, navigate to the directory containing get-pip.py and run

    python get-pip.py

    which creates files in C:\Python27\Scripts, including pip2, pip2.7 and pip.

  3. Copy the downloaded numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl into the above directory (C:\Python27\Scripts)

  4. Still at the command prompt, navigate to the above directory and run:

    pip2.7.exe install "numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl"


回答 2

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy下载numpy-1.9.2 + mkl-cp27-none-win32.whl

将文件复制到C:\ Python27 \ Scripts

从上面的位置运行cmd并输入

pip install numpy-1.9.2+mkl-cp27-none-win32.whl

您有望获得以下输出:

Processing c:\python27\scripts\numpy-1.9.2+mkl-cp27-none-win32.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2

希望对您有用。

编辑1
添加@oneleggedmule的建议:

您也可以在cmd中运行以下命令:

pip2.7 install numpy-1.9.2+mkl-cp27-none-win_amd64.whl

基本上,单独编写点子也可以很好地工作(与原始答案一样)。为了清晰或明确说明,还可以编写2.7版。

Download numpy-1.9.2+mkl-cp27-none-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy .

Copy the file to C:\Python27\Scripts

Run cmd from the above location and type

pip install numpy-1.9.2+mkl-cp27-none-win32.whl

You will hopefully get the below output:

Processing c:\python27\scripts\numpy-1.9.2+mkl-cp27-none-win32.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2

Hope that works for you.

EDIT 1
Adding @oneleggedmule ‘s suggestion:

You can also run the following command in the cmd:

pip2.7 install numpy-1.9.2+mkl-cp27-none-win_amd64.whl

Basically, writing pip alone also works perfectly (as in the original answer). Writing the version 2.7 can also be done for the sake of clarity or specification.


回答 3

(非正式)二进制文件(http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) 为我工作。
我尝试过Mingw,Cygwin,但由于各种原因都失败了。我使用的是Windows 7 Enterprise(64位)。

The (unofficial) binaries (http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) worked for me.
I’ve tried Mingw, Cygwin, all failed due to varies reasons. I am on Windows 7 Enterprise, 64bit.


回答 4

您也可以尝试这样做,Python http://continuum.io/downloads

但是您需要修改环境变量PATH,以使anaconda文件夹位于原始Python文件夹之前。

You may also try this, anaconda http://continuum.io/downloads

But you need to modify your environment variable PATH, so that the anaconda folder is before the original Python folder.


回答 5

并非不可能,程序员在Windows上寻找python,也使用适用于Visual Studio的Python工具。在这种情况下,可以利用附带的“ Python环境”窗口轻松安装其他软件包。默认情况下,在窗口中选择“概述”。您可以在那里选择“点子”。

然后,您可以通过在seach窗口中输入numpy来安装numpy,而无需进行其他工作。已经建议使用核心响应的“安装numpy”指令。

不过,一开始我有2个容易解决的问题:

  • “错误:无法找到vcvarsall.bat”:此问题已在此处解决。尽管我当时没有找到它,而是安装了PythonC ++编译器
  • 然后,安装继续,但由于其他内部异常而失败。安装.NET 3.5可以解决此问题。

最终安装完成。这花了一些时间(5分钟),所以不要提早取消该过程。

It is not improbable, that programmers looking for python on windows, also use the Python Tools for Visual Studio. In this case it is easy to install additional packages, by taking advantage of the included “Python Environment” Window. “Overview” is selected within the window as default. You can select “Pip” there.

Then you can install numpy without additional work by entering numpy into the seach window. The coresponding “install numpy” instruction is already suggested.

Nevertheless I had 2 easy to solve Problems in the beginning:

  • “error: Unable to find vcvarsall.bat”: This problem has been solved here. Although I did not find it at that time and instead installed the C++ Compiler for Python.
  • Then the installation continued but failed because of an additional inner exception. Installing .NET 3.5 solved this.

Finally the installation was done. It took some time (5 minutes), so don’t cancel the process to early.


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。