我正在尝试安装 Python 的地球物理建模软件包 Fatiando。 我使用的是 OS X v10.9.5 的 Mac。我按照官方网站推荐的安装方法(通过 Anaconda)获取了 Fatiando 的所有依赖项。我已经安装了 Xcode。
但是,我收到了一系列警告信息和一个最终的错误消息:
完整的终端输出(1100+行)可以在这里找到。
我已经联系了开发人员,这似乎不是Fatiando的问题。
有什么建议吗?
更新,3月15日
当我第一次发布这篇文章时,我没有安装Xcode,然后我从Apple store下载了最新的Xcode。再试一次,得到相同的消息。然后我读到了这个,并从这里下载了gcc,并直接安装。当我在终端上输入:
但是,我收到了一系列警告信息和一个最终的错误消息:
fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "//anaconda/bin/python -c "import setuptools, tokenize;__file__='/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-QFjo6d-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-CY4vyX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-QFjo6d-build
Macintosh-5:fatiando matteoniccoli$
完整的终端输出(1100+行)可以在这里找到。
我已经联系了开发人员,这似乎不是Fatiando的问题。
有什么建议吗?
更新,3月15日
当我第一次发布这篇文章时,我没有安装Xcode,然后我从Apple store下载了最新的Xcode。再试一次,得到相同的消息。然后我读到了这个,并从这里下载了gcc,并直接安装。当我在终端上输入:
gcc --version
时,我得到了这个:i686-apple-darwin11-llvm-gcc-4.2(GCC)4.2.1(基于Apple Inc. build 5658)(LLVM build 2335.15.00)
之后,我仍然收到类似的消息。按照另一个stackoverflow的提示,我尝试从这里安装setuptools,使用curl https://bootstrap.pypa.io/ez_setup.py -o - | python。现在,当我尝试安装fatiando时,我得到了不同的错误(在长输出的末尾)。fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "//anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-build-m1ieVO/fatiando/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-9wI6Z7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-build-m1ieVO/fatiando
有人在论坛上通过邮件问我: 关于Fatiando,你是否安装了Xcode命令行工具?例如,参考这个链接 http://railsapps.github.io/xcode-command-line-tools.html
但是当我尝试按照建议验证已成功安装Xcode命令行工具时,出现了下面的情况,所以我认为这不是问题的原因:
-bash: /Library/Developer/CommandLineTools: is a directory
3月16日更新 尝试了Leo Uieda建议的解决方案。
pip install --upgrade https://github.com/fatiando/fatiando/archive/kill-omp.zip
命令执行没有问题,但是执行pip install --upgrade https://github.com/fatiando/fatiando/archive/master.zip
后回到了起点:
...
...
fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Rolling back uninstall of fatiando