安装numpy时出错 [英] Error installing numpy

查看:339
本文介绍了安装numpy时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装numpy 我的步骤如下: 在提取的numpy文件夹中打开cmd(我在其中提取了.tar.gz文件) 然后python setup.py安装 但是我收到如下错误: 像这样的许多警告,最终错误无法找到vcvarsall.bat (我很遗憾地放了一张照片,但找不到更好的方法从cmd窗口复制文本) 如果可能的话,建议编译一个numpy的安装程序

I'm trying to install numpy My steps are as follows: Open cmd in numpy extracted folder(where I had extracted .tar.gz file) Then python setup.py install But I'm getting an error as follows: with many warnings like this and at the end error unable to find vcvarsall.bat (I regret to put a photo but I couldn't find any better way to copy text from cmd window) if possible suggest a compiled setup of numpy

推荐答案

显然,这个答案偶尔还是会引起注意.对于任何需要numpy的人,如果您只是去获取 conda或miniconda ,几乎可以肯定,您会更快乐,更高效.这使得安装像numpy这样的各种库非常容易.实际上,页面上的第一个示例是conda install numpy.另外一个好处是:我发现conda作为软件包管理器比virtualenv更好.

Apparently this answer still gets attention occasionally. For anybody needing numpy, you almost certainly will be happier and more productive if you just go and get conda or miniconda which make installing all kinds of libraries like numpy very easy. In fact the first example on the page is conda install numpy. An additional bonus: I find that conda works better as a package manager than virtualenv.

有关stackoverflow的讨论,但找不到.一旦您知道该怎么做就很容易,但并不明显.关键是使用预制的二进制文件,而不是自己+ easy_install进行编译.除非您想自己编译,否则答案就完全不同了.

There is a discussion on this on stackoverflow but I can't find it. It's easy once you know how to do it, but not obvious. The key is to use the premade binaries instead of compiling it yourself + easy_install. Unless you want to compile it yourself and that's a whole different answer.

无论是安装到virtualenv还是仅安装到您的主python,这都是我的工作:

Either installing to virtualenv or just to your main python, here is what I do:

  1. 为Windows和您的版本下载最新的numpy安装程序 python的 此处.

  1. Download the latest numpy installer for windows and your version of python here.

使用7zip或任何其他文件打开该文件.提取 适用于您的CPU的安装程序.可能是SSE3.

Open that file in 7zip or whatever you have. Extract the installer that works for your CPU. Probably SSE3.

将该文件放置在某个位置,并获取文件的完整路径,包括 文件名.

Put that file somewhere and get the full path to it including the name of the file.

在启用或未启用virtualenv的命令行中键入: easy_install "...",带引号和粘贴的完整路径 代替...

From your command line with/without virtualenv activated, type: easy_install "..." with the quotes and with your full path pasted in place of ...

(附加步骤),如果您收到找不到easy_install的错误,则可能需要在系统路径中添加C:\python27\Scripts\(使用实际的python路径).

(extra step) you may need to add C:\python27\Scripts\ to your system path (using your actual python path) if you get an error that easy_install is not found.

应该这样做.如果您想自己进行编译(如果您发布的消息让您迷失了,那么您可能没有这样做),那么您将需要阅读有关在Windows中安装和安装python的c编译器的信息.

That should do it. If you want to compile it yourself (if the message you posted lost you, then you probably don't), then you'll need to read up on getting a c compiler installed and setup in windows for python.

这篇关于安装numpy时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆