简体   繁体   English

py2cairo的构建在带有Homebrew的Mac OS X中失败

[英]Build of py2cairo fails in Mac OS X with Homebrew

I've made the debatable decision to do some network analysis directly in Python instead of R. However, I'm having trouble getting all the igraph dependencies installed, ultimately failing with py2cairo. 我做出了有争议的决定,直接在Python中而不是R中进行一些网络分析。但是,我在安装所有igraph依赖项时遇到了麻烦,最终py2cairo失败了。

After updating Xcode to latest, installed cairo with Homebrew: 将Xcode更新为最新版本后,用Homebrew安装了cairo

brew install cairo

A few warnings there for dependent libraries, and the brew link step failed. 那里有一些关于从属库的警告,并且brew link步骤失败。 After chowning a few directories, I ran brew link again and it worked. 整理好几个目录后,我再次运行brew link ,它成功了。

Then, I uninstalled and re-installed python-igraph using pip . 然后,我使用pip卸载并重新安装了python-igraph

Now I need to install py2cairo from source (I'm running Python 2.7.6 in a virtualenv) and so downloaded it from this source: 现在,我需要从源代码安装py2cairo(我在virtualenv中运行Python 2.7.6),因此从此源代码下载了它:

git clone git://git.cairographics.org/git/py2cairo

Following Install pycairo in virtualenv , I ran ./waf configure --prefix=$VIRTUAL_ENV with no problems. 在virtualenv中安装pycairo之后,我运行./waf configure --prefix=$VIRTUAL_ENV没有问题。

Running ./waf build falls over with these errors: 运行./waf build会因以下错误而./waf build

ld: warning: ignoring file /usr/local/Cellar/cairo/1.14.2_1/lib/libcairo.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/cairo/1.14.2_1/lib/libcairo.dylib
[...]
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I then tried to switch to using autogen.sh . 然后,我尝试切换为使用autogen.sh First problem was that pkg.m4 was missing on my machine, so I tried reinstalling pkg-config with Homebrew again. 第一个问题是我的计算机上缺少pkg.m4,因此我尝试再次使用Homebrew重新安装pkg-config。 Didn't work. 没用 So I downloaded pkg.m4 from here http://web.mit.edu/barnowl/src/pkg-config/pkg-config-0.23/pkg.m4 , then installed libtools with Homebrew, and changed references in autogen to glibtoolize etc. 所以我从这里http://web.mit.edu/barnowl/src/pkg-config/pkg-config-0.23/pkg.m4下载了pkg.m4,然后用Homebrew安装了libtools ,并将autogen中的引用更改为glibtoolize等。

But then autogen.sh terminates with following errors: 但是随后autogen.sh终止并出现以下错误:

autogen.sh: running `aclocal'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/m4:/usr/local/Cellar/automake/1.15/share/aclocal/pkg.m4:155: ERROR: end of file in comment
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1

export ARCHFLAGS='-arch x86_64' # this is for Mac os x ./waf clean ./waf configure --prefix=`python -c "import sys; print sys.prefix"` ./waf build ./waf install

这在我的Mac上效果很好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM