在mac OS X上安装big float

时间:2017-05-04 09:31:49

标签: python macos bigfloat

我正在尝试在OS X上安装big float但我遇到了多个问题。 我没有任何问题安装了放大器,但是当我尝试安装mpfr时出现了这个错误:

Warning: mpfr-3.1.5 already installed, it's just not linked.

这是什么意思? (我使用的是Homebrew)。

然后,很明显,如果我尝试安装bigfloat它没有工作,我得到这个错误:

Collecting bigfloat
Downloading bigfloat-0.3.0.tar.gz (216kB)
100% |████████████████████████████████| 225kB 1.6MB/s 
Installing collected packages: bigfloat
Running setup.py install for bigfloat ... error
Complete output from command /Users/name/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile:
running build_ext
building 'mpfr' extension
creating build
creating build/temp.macosx-10.7-x86_64-2.7
gcc -fno-strict-aliasing -I/Users/name/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/Users/name/anaconda2/include/python2.7 -c mpfr.c -o build/temp.macosx-10.7-x86_64-2.7/mpfr.o
In file included from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/syslimits.h:7:0,
                 from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:34,
                 from /Users/name/anaconda2/include/python2.7/Python.h:19,
                 from mpfr.c:16:
/usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
 #include_next <limits.h>  /* recurse down to the real one */
                                                             ^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/Users//anaconda2/bin/python -u -c "import setuptools,      tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-VCyOBn/bigfloat/

1 个答案:

答案 0 :(得分:0)

您必须安装python-devel

在OS X中尝试再次卸载并安装:

brew uninstall python
brew install python

同样根据this问题,Osx GCC(这只是一个铿锵声的符号链接)并不提供开箱即用的OpenMP支持。您可以使用GCC安装OpenMP

brew install gcc --without-multilib