Ubuntu 上的 rpy2 安装

发布于 2024-10-12 17:15:35 字数 1351 浏览 3 评论 0原文

我对 Linux 还很陌生,在安装 Rpy2 时遇到了一些严重的问题。我通过突触包管理器安装了旧版本的 Rpy2,但我需要更新版本并将其删除(如 Rpy2 文档中所述,Rpy2 目录中的所有文件)。 我下载了tar.gz。来自 SourceForge 并运行此代码:

tar -xzf rpy2-2.1.8.tar.gz
cd rpy2-2.1.8
python setup.py build install

它似乎正在按应有的方式复制文件,但随后多页错误消息(以粗体突出显示)开始浮动:

running build_ext
Configuration for R as a library:
include_dirs: ('/usr/share/R/include',)
libraries: ('lapack', 'blas', 'R')
library_dirs: ('/usr/lib/R/lib',)
extra_link_args: ()
# OSX-specific (included in extra_link_args)
framework_dirs: ()
frameworks: ()
building 'rpy2.rinterface.rinterface' extension
creating build/temp.linux-i686-2.6
creating build/temp.linux-i686-2.6/rpy
creating build/temp.linux-i686-2.6/rpy/rinterface
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes    
-fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_S  
IGJMP=1 -DCSTACK_DEFNS=1 -DRIF_HAS_RSIGHAND=1 -Irpy/rinterface -I/usr/include/python2.6 -I/usr/share/R/include -c rpy/rinterface/rinterface.c -o build/temp.linux-i686-2.6/rpy/rinterface/rinterface.o

**rpy/rinterface/rinterface.c:55:20: error: Python.h: No such file or directory**
In file included from rpy/rinterface/rinterface.c:74:
/usr/share/R/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype

我希望你能帮助我。

谢谢,莱塞

I'm pretty new to Linux and I'm having some serious trouble installing Rpy2. I had an older versions of Rpy2 installed by the synaptic package manager, but I needed an updated version and removed it (all files in the Rpy2 directory as described in the Rpy2 documentation).
I downloaded the tar.gz. from SourceForge and ran this code:

tar -xzf rpy2-2.1.8.tar.gz
cd rpy2-2.1.8
python setup.py build install

It appeared to be copying files as it should, but then multiple pages of error messages (highlighted in bold) just start floating:

running build_ext
Configuration for R as a library:
include_dirs: ('/usr/share/R/include',)
libraries: ('lapack', 'blas', 'R')
library_dirs: ('/usr/lib/R/lib',)
extra_link_args: ()
# OSX-specific (included in extra_link_args)
framework_dirs: ()
frameworks: ()
building 'rpy2.rinterface.rinterface' extension
creating build/temp.linux-i686-2.6
creating build/temp.linux-i686-2.6/rpy
creating build/temp.linux-i686-2.6/rpy/rinterface
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes    
-fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_S  
IGJMP=1 -DCSTACK_DEFNS=1 -DRIF_HAS_RSIGHAND=1 -Irpy/rinterface -I/usr/include/python2.6 -I/usr/share/R/include -c rpy/rinterface/rinterface.c -o build/temp.linux-i686-2.6/rpy/rinterface/rinterface.o

**rpy/rinterface/rinterface.c:55:20: error: Python.h: No such file or directory**
In file included from rpy/rinterface/rinterface.c:74:
/usr/share/R/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype

I hope you can help me.

Thanks, Lasse

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

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

发布评论

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

评论(1

海风掠过北极光 2024-10-19 17:15:35

您的系统上似乎没有 python-dev 软件包。

It looks like you do not have python-dev package on your system.

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