无法在OSX上安装bigfloat,命令'clang'失败,退出状态为1。

3

我正在尝试在OSX Sierra中安装bigfloat:

pip install bigfloat

但是我收到了这个错误提示:
    mpfr.c:343:10: fatal error: 'gmp.h' file not found
    #include "gmp.h"
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/hd/96gvrtvn66dcnbntwn9v3skh0000gp/T/pip-build-adS6t_/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/hd/96gvrtvn66dcnbntwn9v3skh0000gp/T/pip-fwI1xE-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hd/96gvrtvn66dcnbntwn9v3skh0000gp/T/pip-build-adS6t_/bigfloat/

我已经安装了Xcode并运行:

xcode-select --install

我该怎么解决这个问题?
2个回答

3

看起来您缺少 GMP,如果您使用的是brew,请确保使用以下命令同时安装 GMP 和 MPFR:brew install gmp mpfr,它们都是先决条件。


0

对于其他遇到此问题的人,这对我有用:

brew install gmp mpfr
env "CFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib" pip install bigfloat

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接