在OS 10.6.7上安装pygraphviz-python 2.6(gcc-4.2错误) [英] Installing pygraphviz on os 10.6.7 - python 2.6 (gcc-4.2 error)
问题描述
我正在尝试在Mac OS 10.6.7上安装pygraphviz.我正在使用python 2.6.
I am trying to install pygraphviz on mac os 10.6.7. I am using python 2.6.
到目前为止,这是我所做的:
So far here is what I have done :
- 在以下位置下载了Graphviz 2.28: http://www.graphviz.org/Download_macos.php
- 使用以下命令下载pygraphviz:svn co <a href="https://networkx.lanl.gov/svn/pygraphviz/trunk" rel="nofollow"> https://networkx.lanl.gov/svn/pygraphviz/trunk pygraphviz
- 将目录更改为"pygraphviz"
- 取消注释进入setup.py脚本的路径(检查它是否正确;)): 所以脚本变成了:
- downloaded Graphviz 2.28 at : http://www.graphviz.org/Download_macos.php
- downloaded pygraphviz with the command: svn co https://networkx.lanl.gov/svn/pygraphviz/trunk pygraphviz
- Changed directory to "pygraphviz"
- uncommented the path into the setup.py script (checking that it was the right one ;) ) : so the script become :
setup.py:
# OSX, Linux, alternate location
library_path='/usr/local/lib/graphviz'
include_path='/usr/local/include/graphviz'
- 运行"python setup.py install"
,但是该过程失败并显示以下消息(请参见下面的代码): 错误:命令'gcc-4.2'失败,退出状态为1
but the process fails (see the code below) with the message : error: command 'gcc-4.2' failed with exit status 1
client126-234:pygraphviz francois$ python setup.py install
library_path=/usr/local/lib/graphviz
include_path=/usr/local/include/graphviz
running install
running build
running build_py
copying pygraphviz/version.py -> build/lib.macosx-10.6-universal-2.6/pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-
prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/usr/local/include/graphviz
-I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c
pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.6-universal-2.6/pygraphviz/graphviz_wrap.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
我尝试过:
- 取消安装重新安装Graphviz
- 安装Graphviz的开发版本
- 从python包索引(http://pypi.python.org/pypi/pygraphviz)下载pygraphviz,然后重新安装
- 其他安装方式:easy_install pygraphviz(给我同样的错误). macport(无法在我的计算机上安装)
我做错什么了吗?我该如何解决这种错误?
Am I doing something wrong? How can I solved this kind of error?
任何想法都会有很大帮助,
Any ideas would be a great help,
非常感谢
Francois
推荐答案
gcc-4.2
是Apple开发人员工具包Xcode的一部分.您需要先安装它.应该有一个Xcode 3安装程序,其中包含Mac随附的软件恢复DVD,或者可能是硬盘本身或Mac OS X 10.6 DVD随附的软件恢复DVD,或者您可以从Apple Developer Connection网站下载版本(需要注册),或者您可以从Mac Application Store购买较新的Xcode 4版本.如果您确实安装了Xcode 4,则可能需要在安装中添加export ARCHFLAGS='-arch i386 -arch x86_64'
;否则,请执行以下步骤.有关更多信息,请参见此处.
gcc-4.2
is part of Apple's developers tools package, Xcode. You need to install it first. There should be an Xcode 3 installer with either the software restore DVD that came with your Mac or possibly on the hard disk itself or with the Mac OS X 10.6 DVD or you can download a version from the Apple Developer Connection website (registration required) or you can buy a version of the newer Xcode 4 from the Mac Application Store. If you do install Xcode 4, you will likely need to add an export ARCHFLAGS='-arch i386 -arch x86_64'
to your install; see here for more info.
这篇关于在OS 10.6.7上安装pygraphviz-python 2.6(gcc-4.2错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!