rpy2 版本针对一个 R 版本构建,但 运行 链接到另一个
rpy2 version built against one R version but running linked to another
我在使用 rpy2 时收到错误消息。我认为主要问题是 rpy2 链接到我的系统上可能不再存在的旧 R 版本。
我不久前安装了 rpy2,当时可能有一个较旧的 R 版本。我尝试通过重新安装 rpy2 来解决问题,但没有成功。
python3 -m rpy2.tests
导致
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Warnmeldung:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: In local({ :
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: nicht passende Bytecode Versionen; nutze eval
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Fehler in !value : ungültiger Argumenttyp
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Zusätzlich:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Paket ‘methods’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Warnmeldungen:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 1: Paket ‘datasets’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 2: Paket ‘utils’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
rpy2 version: 2.9.5
- built against R version: 3-4.4--74408
- running linked to R version: R version 3.3.1 (2016-06-21)
E
======================================================================
ERROR: __main__ (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/tests.py", line 43, in load_tests
suite_robjects = loader.discover('robjects', pattern, rpy_root)
File "/usr/lib/python3.5/unittest/loader.py", line 290, in discover
__import__(start_dir)
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/__init__.py", line 19, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/__init__.py", line 19, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/robject.py", line 52, in <module>
class RObjectMixin(object):
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/robject.py", line 66, in RObjectMixin
__show = rpy2.rinterface.baseenv.get("show")
LookupError: 'show' not found
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
我想主要问题如下:
针对 R 版本构建:3-4.4--74408 符合我当前的 R 版本。这应该是正确的。
但是 运行 链接到 R version: R version 3.3.1 (2016-06-21) 似乎是错误的。我很确定我的系统上不再存在这样的版本。不过可能是我第一次安装rpy2时的那个版本
我的系统是 Ubuntu 16.04,我使用的是 Python 3.5.2(默认,2018 年 11 月 12 日,13:43:14),R 版本 3.4.4(2018-03- 15) 和 rpy2-2.9.5-py3.5-linux-x86_64.
非常感谢您。
编辑:
我现在更纳闷了
python3 -m rpy2.situation
给予
Python version:
3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609]
Looking for R's HOME:
Environment variable R_HOME: None
Calling `R RHOME`: /usr/lib/R
InstallPath in the registry: *** Only available on Windows ***
R version:
In the PATH: R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Used to build rpy2: 3-4.4--74408
Additional directories to load R packages from:
None
这看起来完全没问题。我仍然不知道为什么 rpy2 链接到 R 版本 3.3.1。
您可以尝试以下方法来获取有关 rpy2 是如何构建的以及它在运行时找到的 R 版本在哪里的信息:
python -m rpy2.situation
除此之外,您可能需要检查是否设置了环境变量 LD_LIBRARY_PATH
或 LD_PRELOAD
,因为它可能会影响加载哪个 R 共享库。
我在使用 rpy2 时收到错误消息。我认为主要问题是 rpy2 链接到我的系统上可能不再存在的旧 R 版本。
我不久前安装了 rpy2,当时可能有一个较旧的 R 版本。我尝试通过重新安装 rpy2 来解决问题,但没有成功。
python3 -m rpy2.tests
导致
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Warnmeldung:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: In local({ :
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: nicht passende Bytecode Versionen; nutze eval
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Fehler in !value : ungültiger Argumenttyp
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Zusätzlich:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Paket ‘methods’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: Warnmeldungen:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 1: Paket ‘datasets’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/rinterface/__init__.py:146: RRuntimeWarning: 2: Paket ‘utils’ wurde unter R Version 3.4.4 erstellt
warnings.warn(x, RRuntimeWarning)
rpy2 version: 2.9.5
- built against R version: 3-4.4--74408
- running linked to R version: R version 3.3.1 (2016-06-21)
E
======================================================================
ERROR: __main__ (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/tests.py", line 43, in load_tests
suite_robjects = loader.discover('robjects', pattern, rpy_root)
File "/usr/lib/python3.5/unittest/loader.py", line 290, in discover
__import__(start_dir)
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/__init__.py", line 19, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/__init__.py", line 19, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/robject.py", line 52, in <module>
class RObjectMixin(object):
File "/usr/local/lib/python3.5/dist-packages/rpy2-2.9.5-py3.5-linux-x86_64.egg/rpy2/robjects/robject.py", line 66, in RObjectMixin
__show = rpy2.rinterface.baseenv.get("show")
LookupError: 'show' not found
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
我想主要问题如下:
针对 R 版本构建:3-4.4--74408 符合我当前的 R 版本。这应该是正确的。 但是 运行 链接到 R version: R version 3.3.1 (2016-06-21) 似乎是错误的。我很确定我的系统上不再存在这样的版本。不过可能是我第一次安装rpy2时的那个版本
我的系统是 Ubuntu 16.04,我使用的是 Python 3.5.2(默认,2018 年 11 月 12 日,13:43:14),R 版本 3.4.4(2018-03- 15) 和 rpy2-2.9.5-py3.5-linux-x86_64.
非常感谢您。
编辑: 我现在更纳闷了
python3 -m rpy2.situation
给予
Python version:
3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609]
Looking for R's HOME:
Environment variable R_HOME: None
Calling `R RHOME`: /usr/lib/R
InstallPath in the registry: *** Only available on Windows ***
R version:
In the PATH: R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Used to build rpy2: 3-4.4--74408
Additional directories to load R packages from:
None
这看起来完全没问题。我仍然不知道为什么 rpy2 链接到 R 版本 3.3.1。
您可以尝试以下方法来获取有关 rpy2 是如何构建的以及它在运行时找到的 R 版本在哪里的信息:
python -m rpy2.situation
除此之外,您可能需要检查是否设置了环境变量 LD_LIBRARY_PATH
或 LD_PRELOAD
,因为它可能会影响加载哪个 R 共享库。