随笔 - 934, 文章 - 0, 评论 - 249, 阅读 - 345万

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

Mac下安装最新版本的Graphviz

Posted on   蝈蝈俊  阅读(4317)  评论(1编辑  收藏  举报

由于版本兼容问题,Mac下Graphviz之前一直装的是低版本的2.36。高版本的安装方法如下:

 

1、log in & download Xcode an Xcode Command Line Tools from
https://developer.apple.com/downloads/
install Xcode and the Xcode Command Line Tools


2、agree to Xcode license in terminal:
sudo xcodebuild –license


3、get MacPorts pkg installer for your version of osx from
https://www.macports.org/install.php#installing
install MacPorts for your version of osx

 


4、in terminal:
sudo port -v selfupdate


5、install graphviz via MacPorts. in terminal:
sudo port install graphviz-gui


installed gui application can be found here: /Application/Macports/Graphviz.app

相关MacPorts的命令说明可以看: http://blog.csdn.net/moliyll/article/details/7898600

 

我这里由于有之前的版本的 graphviz, 安装时候提示:

$ sudo port install graphviz-gui
--->  Computing dependencies for graphviz-gui
--->  Cleaning graphviz-gui
--->  Scanning binaries for linking errors
Warning: Error parsing file /Applications/MacPorts/Graphviz.app/Contents/MacOS/Graphviz: Error opening or reading file
--->  No broken files found.

解决方法:

先用 AppCleaner 清除之前的安装文件。

再用 sudo port uninstall graphviz-gui 卸载之前的安装依赖。

然后重新安装就可以安装成功了 2.40.1。

 

另外在做安装时,提示我要设置一些默认python 。 执行下面任何一个命令都可以完成。

--->  Some of the ports you installed have notes:
  python27 has the following notes:
    To make this the default Python or Python 2 (i.e., the version run by the
    'python' or 'python2' commands), run one or both of:
   
        sudo port select --set python python27
        sudo port select --set python2 python27
   
    ##############################################################
    # IF YOU ARE USING PYTHON FROM THE TERMINAL, PLEASE INSTALL:
    #   py27-readline
    # TO AVOID A LIBEDIT / PYTHON INTERACTION ISSUE.
    # REF: https://trac.macports.org/ticket/48807
    ##############################################################

 

这种方式安装完成后, GUI和命令行都是升级到了 2.40.1 版本了。

 

$ dot -V
dot - graphviz version 2.40.1 (20161225.0304)

 

参考:

http://www.graphviz.org/Download_macos.php  这里的评论部分。

http://blog.csdn.net/Zoe_Su/article/details/52563062

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
点击右上角即可分享
微信分享提示