When trying to import rpy into python interpreter, it gives following error: Python 2.5.2 (r252:60911, Apr 20 2008, 11:37:37) [GCC 4.2.3 (Gentoo 4.2.3 p1.0)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from rpy import r Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.5/site-packages/rpy.py", line 134, in <module> """ % RVERSION) RuntimeError: /usr/lib64/python2.5/site-packages/_rpy2070.so: undefined symbol: KillAllDevices
`emerge --info' and `emerge -vp dev-python/rpy', please.
plaes@chi ~ $ emerge --info Portage 2.1.5_rc6 (default-linux/amd64/2007.0/no-multilib, gcc-4.2.3, glibc-2.7-r2, 2.6.25-05301-gc3bf9bc x86_64) ================================================================= System uname: 2.6.25-05301-gc3bf9bc x86_64 Intel(R) Core(TM)2 CPU L7400 @ 1.50GHz Timestamp of tree: Sun, 27 Apr 2008 12:30:04 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.5 dev-lang/python: 2.5.2-r2 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 9999 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.62 sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.25-r1 ACCEPT_KEYWORDS="amd64 ~amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -ggdb -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=native -ggdb -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache collision-protect distlocks multilib-strict parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="et_EE.UTF-8" LDFLAGS="" LINGUAS="en et" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/plaes/code/gentoo/gnome /home/plaes/code/gentoo/local" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acpi adns alsa amd64 amr apache2 ares avahi berkdb blas bluetooth branding bzip2 cairo cdr cjk cli cracklib crypt cups curl daap dbus dga djvu dri dvd dvdr dvi eds encode exif fam ffmpeg fftw flac fortran fuse galago gdbm gif gimp glitz gmp gnome gnome-keyring gnuplot gnutls gphoto2 gs gsl gstreamer gtk hal hdri iconv idn ipv6 isdnlog jpeg kdrive lapack laptop latex lcms libnotify lzma lzo mad midi mmx mng mozdevelop mp3 mpeg mudflap nautilus ncurses network network-cron networkmanager nls nptl nptlonly nsplugin ogg opengl openmp pam pcmcia pcre pcsc-lite pdf perl png pppd python readline reflection resolvconf samba sdl session smartcard smp source spl sse sse2 ssl svg tcpd theora tiff truetype unicode usb vim-syntax vorbis x264 xcb xinerama xml xmp xorg xulrunner xv xvid xvmc zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en et" USERLAND="GNU" VIDEO_CARDS="i810" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
(In reply to comment #0) > When trying to import rpy into python interpreter, it gives following error: > I have the same error. Apparently libR.so has a different name for appropriate symbol. I've written a simple patch (I'm going to attach it), it works on x86, alpha, ia64 and amd64.
Created attachment 151607 [details, diff] a patch to make rpy work with R-2.7 Simply changes the name of KillAllDevice function if R version is higher than R-2.7 (I had no errors with R-2.6.2...)
Comment on attachment 151607 [details, diff] a patch to make rpy work with R-2.7 ><html><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- rpy-1.0.2.orig/src/rpymodule.c 2008-04-10 18:49:04.000000000 +0200 >+++ rpy-1.0.2/src/rpymodule.c 2008-05-02 14:28:42.000000000 +0200 >@@ -1778,7 +1778,11 @@ > R_dot_Last(); > R_RunExitFinalizers(); > CleanEd(); >+#if (R_VERSION >= R_Version(2,7,0)) >+ Rf_KillAllDevices(); >+#else > KillAllDevices(); >+#endif > > #if (R_VERSION >= R_Version(2,4,0)) > R_CleanTempDir(); ></pre></body></html>
Sorry, the patch contained a wrong R version (2.4.0 in place of 2.7.0)... d
Fixed in rpy-1.0.2-r1. Thanks for the patch!
(In reply to comment #7) > Fixed in rpy-1.0.2-r1. Thanks for the patch! > You're welcome! I really needed it!