如何在 Ubuntu 14.04.2 上使用 rpy2 2.6.1 克服 ImportError
How to overcome ImportError with rpy2 2.6.1 on Ubuntu 14.04.2
我无法在 Ubuntu 14.04.2 LTS 上获取 rpy2。我有 python 版本 2.7.6 和 运行
sudo pip install rpy2
这看起来很成功。
Collecting rpy2
Using cached rpy2-2.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from rpy2)
Requirement already satisfied (use --upgrade to upgrade): singledispatch in /usr/local/lib/python2.7/dist-packages/singledispatch-3.4.0.3-py2.7.egg (from rpy2)
Building wheels for collected packages: rpy2
Running setup.py bdist_wheel for rpy2
Stored in directory: /home/xxxxx/.cache/pip/wheels/7e/c7/b8/71c07d811319f897a43c9803d5cd890c66f4d18c3b6aa03e11
Successfully built rpy2
Installing collected packages: rpy2
Successfully installed rpy2-2.6.1
但是当我尝试测试时
python -m rpy2.tests
结果并不乐观:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/rpy2/tests.py", line 23, in <module>
import rpy2.tests_rpy_classic
File "/usr/local/lib/python2.7/dist-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
import rpy2.rpy_classic as rpy
File "/usr/local/lib/python2.7/dist-packages/rpy2/rpy_classic.py", line 5, in <module>
import rpy2.rinterface as ri
File "/usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py", line 100, in <module>
from rpy2.rinterface._rinterface import *
ImportError: /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/_rinterface.so: undefined symbol: Rf_allocVector3
我用谷歌搜索了这个错误,但找不到任何与 Rf_allocVector3
相关的内容
我运行的R版本是3.0.2,以防有影响。
非常感谢任何帮助。
我认为 R 版本对于 rpy2-2.6.0 来说太旧了。
文档让人希望 R-3.0.x 没问题,但我认为情况并非如此:http://rpy.sourceforge.net/rpy2/doc-2.6/html/overview.html#requirements
我无法在 Ubuntu 14.04.2 LTS 上获取 rpy2。我有 python 版本 2.7.6 和 运行
sudo pip install rpy2
这看起来很成功。
Collecting rpy2
Using cached rpy2-2.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from rpy2)
Requirement already satisfied (use --upgrade to upgrade): singledispatch in /usr/local/lib/python2.7/dist-packages/singledispatch-3.4.0.3-py2.7.egg (from rpy2)
Building wheels for collected packages: rpy2
Running setup.py bdist_wheel for rpy2
Stored in directory: /home/xxxxx/.cache/pip/wheels/7e/c7/b8/71c07d811319f897a43c9803d5cd890c66f4d18c3b6aa03e11
Successfully built rpy2
Installing collected packages: rpy2
Successfully installed rpy2-2.6.1
但是当我尝试测试时
python -m rpy2.tests
结果并不乐观:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/rpy2/tests.py", line 23, in <module>
import rpy2.tests_rpy_classic
File "/usr/local/lib/python2.7/dist-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
import rpy2.rpy_classic as rpy
File "/usr/local/lib/python2.7/dist-packages/rpy2/rpy_classic.py", line 5, in <module>
import rpy2.rinterface as ri
File "/usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py", line 100, in <module>
from rpy2.rinterface._rinterface import *
ImportError: /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/_rinterface.so: undefined symbol: Rf_allocVector3
我用谷歌搜索了这个错误,但找不到任何与 Rf_allocVector3
相关的内容我运行的R版本是3.0.2,以防有影响。
非常感谢任何帮助。
我认为 R 版本对于 rpy2-2.6.0 来说太旧了。
文档让人希望 R-3.0.x 没问题,但我认为情况并非如此:http://rpy.sourceforge.net/rpy2/doc-2.6/html/overview.html#requirements