Python 安装 scipy 时“失败,错误代码 1”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30919393/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"failed with error code 1" while installing scipy
提问by Rodolphe LAMPE
I have Python 2.7.9 on windows 7 64-bits. I'm trying to install scipy using pip. I used pip install scipy
but I get the following error :
我在 Windows 7 64 位上有 Python 2.7.9。我正在尝试使用 pip 安装 scipy。我使用过,pip install scipy
但出现以下错误:
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\us
ers\admin\appdata\local\temp\pip-build-xpl5cw\scipy\setup.py';exec(compil
e(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file
__, 'exec'))" install --record c:\users\admin\appdata\local\temp\pip-b68pfc-reco
rd\install-record.txt --single-version-externally-managed --compile" failed with
error code 1 in c:\users\admin\appdata\local\temp\pip-build-xpl5cw\scipy
I searched on google and stackoverflow for solutions but nothing worked. I tried upgrading pip and it didn't work too.
我在 google 和 stackoverflow 上搜索了解决方案,但没有任何效果。我尝试升级 pip 但它也不起作用。
Here are my installed packages and their versions :
这是我安装的软件包及其版本:
httplib2 (0.9.1)
nltk (3.0.3)
nose (1.3.7)
numpy (1.9.2)
pip (7.0.3)
pytz (2015.4)
scikit-learn (0.16.1)
setuptools (17.1.1)
six (1.9.0)
twilio (4.4.0)
wheel (0.24.0)
采纳答案by Hack-R
On Windows, you'll need to use the unofficial precompiled binaries:
在 Windows 上,您需要使用非官方的预编译二进制文件:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Select the version matching your architecture and Python version.
选择与您的架构和 Python 版本匹配的版本。
回答by Zahra
I'm on Ubuntu 14.04. I tried installing through pip which kept on failing with error code 1 or took forever to finish (never finished actually!). However, the following command worked without a hitch:
我在 Ubuntu 14.04 上。我尝试通过 pip 安装,但它一直失败并显示错误代码 1 或花了很长时间才完成(实际上从未完成!)。但是,以下命令可以顺利运行:
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
Reference: http://www.scipy.org/install.html
回答by Jurgis Lietunovas
Installing setuptoolsmade it work for me (Mac OS)
安装setuptools对我有用(Mac OS)
pip install -U pip setuptools