无法安装 R 包“Rgraphviz”在 Mac OS X Lion 上

发布于 2024-12-27 20:43:12 字数 1668 浏览 4 评论 0原文

我花了很多时间试图解决这个问题,但仍然没有成功。我正在尝试让 Rgraphviz 在 Max OS X Lion 上使用 R 2.14.1

以下是我在 Mac OS X Lion 上安装和使用 Rgraphviz 所采取的步骤:

  1. 通过以下方式安装 graphviz:sudo port安装graphviz

  2. 检查安装是否成功:pkg-config --modversion libgvc

结果:2.28.0 <- 这意味着它没问题

<强>在R 2.14.1下

来源(“http://www.bioconductor.org/biocLite.R”) biocLite("Rgraphviz")

每当我尝试使用该库时,我都会收到以下错误

Error : .onLoad failed in loadNamespace() for 'Rgraphviz', details:
call: value[[3L]](cond)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so, 6): Library not loaded: /usr/local/lib/libgvc.5.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so

Check that (1) graphviz is installed on your system; (2) the installed version of
graphviz matches '2.26.3'; this is the version used to build this Rgraphviz
package; (3) graphviz is accessible to R, e.g., the path to the graphviz 'bin'
directory is in the system 'PATH' variable.  See additional instructions in the
'README' file of the Rgraphviz 'source' distribution, available at

我注意到的一些事情

  • “帮助”文件中建议的 graphviz 是 2.26.3,Mac Ports 安装的 graphviz 是 2.28.0 ,但由于它是较新的版本,我认为这没有什么区别,而且我找不到 v 2.26.3
  • 建议编号 (3) 似乎是关键,但我在 graphbiz 下找不到/没有 bin 目录

另外,当我运行 locate Rgraphviz.so 时,没有结果。

任何有关解决方案的线索将不胜感激, 多谢!

I have spent a lot of time trying to solve this, but still no luck. I am trying to get Rgraphviz to work with R 2.14.1 on a Max OS X Lion

These are the steps I took in order to install and use Rgraphviz on Mac OS X Lion:

  1. Installed graphviz via: sudo port install graphviz

  2. Checked that the installation was successful : pkg-config --modversion libgvc

Result: 2.28.0 <- That means its OK

Under R 2.14.1

source("http://www.bioconductor.org/biocLite.R")
biocLite("Rgraphviz")

Whenever I try to use the library I get the following error

Error : .onLoad failed in loadNamespace() for 'Rgraphviz', details:
call: value[[3L]](cond)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so, 6): Library not loaded: /usr/local/lib/libgvc.5.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rgraphviz/libs/i386/Rgraphviz.so

Check that (1) graphviz is installed on your system; (2) the installed version of
graphviz matches '2.26.3'; this is the version used to build this Rgraphviz
package; (3) graphviz is accessible to R, e.g., the path to the graphviz 'bin'
directory is in the system 'PATH' variable.  See additional instructions in the
'README' file of the Rgraphviz 'source' distribution, available at

Some things I notice

  • The graphviz suggested in the "help" file is 2.26.3 and the graphviz installed by Mac Ports is 2.28.0, but as it is a newer version I don't think this makes a difference, and besides I can not find v 2.26.3
  • Suggestion number (3) seems to be the key, but I can't find/don't have a bin directory under graphbiz

Also when I run a locate Rgraphviz.so there are no results.

Any clue towards a solution will be much appreciated,
Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

翻身的咸鱼 2025-01-03 20:43:12

感谢您的最终答复,安装似乎对我有用! (我仍然需要检查包是否正常运行)。快速观察一下:Graphviz 安装在我的机器上的 /usr/local 中,因此必须输入上述命令,如下所示:

sudo R CMD INSTALL --configure-args='--with-graphviz=/usr/local' Rgraphviz_1.32.0.tar.gz

Thanks for the final answer, the installation seems to work for me! (I still have to check that the package runs properly). Just a quick observation: Graphviz was installed in /usr/local on my machine so that the above command had to be entered as follows:

sudo R CMD INSTALL --configure-args='--with-graphviz=/usr/local' Rgraphviz_1.32.0.tar.gz
献世佛 2025-01-03 20:43:12

又一个失败点。如果您使用 Fink 安装 graphviz,即使在使用配置参数指向 graphviz 后,您仍然可能像我一样遇到单独的构建错误,现在看起来像:

R CMD INSTALL --configure-args='--with-graphviz=/sw' Rgraphviz_1.34.0.tar.gz 

在 LL_funcs.c 的构建错误期间安装将失败,因为它是寻找除非您还安装 graphviz-dev 否则不会安装的库。您将看到这一点:

In file included from LL_funcs.c:1:
common.h:31:17: error: gvc.h: No such file or directory
common.h:32:22: error: gvplugin.h: No such file or directory
common.h:35:20: error: gvcext.h: No such file or directory
common.h:39:20: error: gvcjob.h: No such file or directory

当然,接下来还会出现更多构建错误。请务必

fink install graphviz-dev

One more fail point. If you used Fink to install graphviz, you may still, like me, encounter separate build errors even after you use the configure arguments to point to graphviz, which now look like:

R CMD INSTALL --configure-args='--with-graphviz=/sw' Rgraphviz_1.34.0.tar.gz 

The installation will fail during build errors for LL_funcs.c because it is looking for libraries that do not install unless you ALSO install graphviz-dev. You will see this:

In file included from LL_funcs.c:1:
common.h:31:17: error: gvc.h: No such file or directory
common.h:32:22: error: gvplugin.h: No such file or directory
common.h:35:20: error: gvcext.h: No such file or directory
common.h:39:20: error: gvcjob.h: No such file or directory

followed by many more build errors of course. Just be sure to

fink install graphviz-dev
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文