gpt4 book ai didi

python - pip install numpy 的问题 - RuntimeError : Broken toolchain: cannot link a simple C program

转载 作者:IT老高 更新时间:2023-10-28 21:33:27 26 4
gpt4 key购买 nike

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

我不断收到这些错误:

RuntimeError: Broken toolchain: cannot link a simple C program

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

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

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

我使用的是 Mac OSX 10.9使用 brew 安装的 python

编辑
是的,正在尝试使用 pip 安装。
整个回溯很大(>400 行)

这是其中的一部分:

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

最佳答案

对于 Docker (Alpine) 和 Python 3.x,这对我有用:

RUN apk update
RUN apk add make automake gcc g++ subversion python3-dev

关于python - pip install numpy 的问题 - RuntimeError : Broken toolchain: cannot link a simple C program,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22388519/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com