Python 在Os X 10.5.8上安装Graphviz

Python 在Os X 10.5.8上安装Graphviz,python,graphviz,pygraphviz,Python,Graphviz,Pygraphviz,我正在尝试在osX 10.5.8上安装Graphviz 2.14.1 我在这里安装了通用二进制文件中的Graphviz: http://www.ryandesign.com/graphviz/ $ svn co https://networkx.lanl.gov/svn/pygraphviz/trunk pygraphviz - Fingerprint: 43:8e:fa:75:00:60:67:07:fd:04:3c:e7:bf:25:86:fd:66:b3:f6:cb (R

我正在尝试在osX 10.5.8上安装Graphviz 2.14.1
我在这里安装了通用二进制文件中的Graphviz:

http://www.ryandesign.com/graphviz/  

$ svn co https://networkx.lanl.gov/svn/pygraphviz/trunk pygraphviz  

 - Fingerprint: 43:8e:fa:75:00:60:67:07:fd:04:3c:e7:bf:25:86:fd:66:b3:f6:cb  
(R)eject, accept (t)emporarily or accept (p)ermanently? t  
A    pygraphviz/pygraphviz  
A    pygraphviz/pygraphviz/graphviz.i  
A    pygraphviz/pygraphviz/graphviz.py  
A    pygraphviz/pygraphviz/tests  
A    pygraphviz/pygraphviz/tests/graph.txt  
A    pygraphviz/pygraphviz/tests/attributes.txt  
A    pygraphviz/pygraphviz/tests/__init__.py  
A    pygraphviz/pygraphviz/tests/test.py  
A    pygraphviz/pygraphviz/tests/layout_draw.txt  
A    pygraphviz/pygraphviz/graphviz_wrap.c  
A    pygraphviz/pygraphviz/__init__.py  
A    pygraphviz/pygraphviz/release.py  
A    pygraphviz/pygraphviz/agraph.py  
A    pygraphviz/INSTALL.txt  
A    pygraphviz/doc  
A    pygraphviz/doc/source  
A    pygraphviz/doc/source/contents.rst  
A    pygraphviz/doc/source/examples.rst  
A    pygraphviz/doc/source/static  
A    pygraphviz/doc/source/static/contents.png  
A    pygraphviz/doc/source/static/navigation.png  
A    pygraphviz/doc/source/static/sphinxdoc.css  
A    pygraphviz/doc/source/static/empty.txt  
A    pygraphviz/doc/source/tutorial.rst  
A    pygraphviz/doc/source/conf.py  
A    pygraphviz/doc/source/install.rst  
A    pygraphviz/doc/source/download.rst  
A    pygraphviz/doc/source/reference  
A    pygraphviz/doc/source/reference/news.rst  
A    pygraphviz/doc/source/reference/credits.rst  
A    pygraphviz/doc/source/reference/related.rst  
A    pygraphviz/doc/source/reference/api_notes.rst  
A    pygraphviz/doc/source/reference/history.rst  
A    pygraphviz/doc/source/reference/agraph.rst  
A    pygraphviz/doc/source/reference/legal.rst  
A    pygraphviz/doc/source/reference/faq.rst  
A    pygraphviz/doc/source/reference/index.rst  
A    pygraphviz/doc/source/templates  
A    pygraphviz/doc/source/templates/layout.html  
A    pygraphviz/doc/source/templates/indexsidebar.html  
A    pygraphviz/doc/source/templates/index.html  
A    pygraphviz/doc/sphinxext  
A    pygraphviz/doc/sphinxext/only_directives.py  
A    pygraphviz/doc/Makefile  
A    pygraphviz/setup.py  
A    pygraphviz/setup_egg.py  
A    pygraphviz/setup_extra.py  
A    pygraphviz/MANIFEST.in  
A    pygraphviz/README.txt  
A    pygraphviz/examples  
A    pygraphviz/examples/miles.py  
A    pygraphviz/examples/simple.py  
A    pygraphviz/examples/star.py  
A    pygraphviz/examples/django_simple.py  
A    pygraphviz/examples/subgraph.py  
A    pygraphviz/examples/attributes.py  
A    pygraphviz/examples/miles_dat.txt.gz  
A    pygraphviz/setup.cfg  
 U   pygraphviz  
Checked out revision 1947.  
Bryan@bryan-wheelocks-macbook-pro-15 Tue Dec 21 07:25:18 ~/Downloads   
$ cd pygraphviz/  
Bryan@bryan-wheelocks-macbook-pro-15 Tue Dec 21 07:25:22 ~/Downloads/pygraphviz   
$ python setup.py install  
Trying pkg-config  
/bin/sh: pkg-config: command not found  
/bin/sh: pkg-config: command not found  
Trying dotneato-config  
Failed to find dotneato-config  

Your graphviz installation could not be found.  

Either the graphviz package is missing on incomplete  
(binary packages graphviz-dev or graphviz-devel missing?).    

If you think your installation is correct you will need to manually  
change the include_path and library_path variables in setup.py to  
point to the correct locations of your graphviz installation.  

The current setting of library_path and include_path is:  
library_path=None  
include_path=None  

Traceback (most recent call last):  
  File "setup.py", line 78, in <module>  
    raise OSError,"Error locating graphviz."  
OSError: Error locating graphviz.  
$python setup.py安装--library_path/usr/local/lib/graphviz/

Trying pkg-config  
/bin/sh: pkg-config: command not found  
/bin/sh: pkg-config: command not found  
Trying dotneato-config  
Failed to find dotneato-config  

Your graphviz installation could not be found.  

Either the graphviz package is missing on incomplete  
(binary packages graphviz-dev or graphviz-devel missing?).    

If you think your installation is correct you will need to manually  
change the include_path and library_path variables in setup.py to  
point to the correct locations of your graphviz installation.  

The current setting of library_path and include_path is:  
library_path=None  
include_path=None  

Traceback (most recent call last):  
  File "setup.py", line 78, in <module>  
    raise OSError,"Error locating graphviz."  
OSError: Error locating graphviz.  
正在尝试pkg配置
/bin/sh:pkg config:未找到命令
/bin/sh:pkg config:未找到命令
正在尝试配置
未能找到dotneato配置
找不到您的graphviz安装。
graphviz程序包在未完成时丢失
(graphviz-dev或graphviz-devel缺少二进制包?)。
如果您认为安装正确,则需要手动
将setup.py中的include_path和library_path变量更改为
指向graphviz安装的正确位置。
库路径和包含路径的当前设置为:
库路径=无
包含路径=无
回溯(最近一次呼叫最后一次):
文件“setup.py”,第78行,在
引发OSError,“定位图形时出错。”
OSError:定位graphviz时出错。
我找不到二进制包graphviz-dev或graphviz-devel


我需要做什么才能安装此软件?

2.14.1是graphviz的一个非常旧的版本。在使用2.26版的官方OSX安装程序包时,您可能会获得更好的成功(在撰写本文时)。然后您可能需要编辑pygraphiz
setup.py
,以使用正确的
库路径和
包含路径。您很可能需要取消注释
/usr/local/lib/graphviz
usr/local/include/graphviz
版本,但使用
ls/usr/local
来确定

另一方面,由于涉及到如此多的依赖库和软件包,这是使用第三方软件包管理器(如
MacPorts
)的完美案例,它将为您管理所有依赖项,并允许您在新版本可用时轻松更新。安装后,您可以通过以下方式安装:

$ sudo port selfupdate
#   either
$ sudo port install py26-pygraphviz   # with MacPorts python2.6
#   ... or 
$ sudo port install py27-pygraphviz   # with MacPorts python2.7
正如内德所说

  • 找到graphviz的setup.py文件。在我的例子中,它位于
    /Users/*my_username*/build/pygraphviz/setup.py
  • 最后,为
    library\u path
    include\u path
    取消注释与Mac OSX路径对应的行。这些行包含:
    /usr/local/lib/graphviz
    usr/local/include/graphviz

  • 您似乎缺少“pkg config”包。您可以使用安装

    brew安装程序包配置


    这更适合超级用户。在我的例子中,二进制文件位于
    /usr/local/bin/dot
    ,安装了pkg-config,但仍然出现错误。链接再次解决了这个问题<代码>brew取消链接pkg配置和brew链接pkg配置
    $ sudo port selfupdate
    #   either
    $ sudo port install py26-pygraphviz   # with MacPorts python2.6
    #   ... or 
    $ sudo port install py27-pygraphviz   # with MacPorts python2.7