簡體   English   中英

無法在 osx 中安裝 bigfloat,命令“clang”失敗,退出狀態為 1

[英]unable to install bigfloat in osx, command 'clang' failed with exit status 1

我正在嘗試在 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

我該如何解決這個問題?

看起來您缺少 GMP,如果您使用 brew 確保使用brew install gmp mpfr安裝 GMP 和 MPFR,它們都是先決條件。

對於其他有此問題的人,這對我有用:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM