pip安装numpy的问题-RuntimeError:断开的工具链:无法链接简单的C程序 [英] Problems with pip install numpy - RuntimeError: Broken toolchain: cannot link a simple C program

查看:184
本文介绍了pip安装numpy的问题-RuntimeError:断开的工具链:无法链接简单的C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将numpy(以及scipy和matplotlib)安装到virturalenv中.

I'm trying to install numpy (and scipy and matplotlib) into a virturalenv.

尽管如此,我仍然收到以下错误消息:

I keep getting these errors though:

RuntimeError: Broken toolchain: cannot link a simple C program

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1

我已经安装了用于xcode的命令行工具

I have the command line tools for xcode installed

$ which gcc
/usr/bin/gcc
$ which cc
/usr/bin/cc

我在Mac OSX 10.9上 使用安装了brew的python

I'm on Mac OSX 10.9 Using a brew installed python

修改
是的,尝试通过pip安装.
整个回溯是巨大的(> 400行)

Edit
Yes, trying to install with pip.
The whole traceback is huge (>400 lines)

这是其中的一部分:

C compiler: cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe



compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'

cc: _configtest.c

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

failure.

removing: _configtest.c _configtest.o

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/setup.py", line 192, in <module>

    setup_package()

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/setup.py", line 185, in setup_package

    configuration=configuration )

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/core.py", line 169, in setup

    return old_setup(**new_attr)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/command/egg_info.py", line 10, in run

    self.run_command("build_src")

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/command/build_src.py", line 153, in run

    self.build_sources()

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources

    self.build_library_sources(*libname_info)

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources

    sources = self.generate_sources(sources, (lib_name, build_info))

  File "/Users/bdhammel/Documents/research_programming/julia_env/build/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources

    source = func(extension, build_dir)

  File "numpy/core/setup.py", line 674, in get_mathlib_info

    raise RuntimeError("Broken toolchain: cannot link a simple C program")

RuntimeError: Broken toolchain: cannot link a simple C program

推荐答案

虽然丑陋,但似乎可以使用

While it's ugly, it appears to work

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade numpy

请注意,如果对于除numpy之外的其他程序包遇到此错误,(例如lxml)请在该命令的末尾指定该程序包名称,而不是numpy.

Note that if you are getting this error for a package other than numpy, (such as lxml) specify that package name instead of numpy at the end of the commnd.

我看到有人在安装gem时遇到类似的问题

I saw a similar issue someone was having with installing a gem

Ruby宝石安装Json在Mavericks和Xcode 5.1上失败-未知参数:'-multiply_definedsuppress'

这只是一个临时修复,在某些时候必须修复编译器选项

This is only a temporary fix, at some point the compiler options will have to be fixed

这篇关于pip安装numpy的问题-RuntimeError:断开的工具链:无法链接简单的C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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