在Linux上安装Rpy2时出错

时间:2014-04-28 16:22:55

标签: python rpy2

我试图在Linux上安装Rpy2版本2-2.2.1,我收到以下错误。

以下是我看到的两条错误消息:

/usr/local/msg/lib64/R/bin/exec/R: error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory

    rversion = m.groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'

这里有完整的输出:

[user@user-ws ~]$ cd rpy2-2.2.1/
[user@user-ws rpy2-2.2.1]$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/rpy2
copying ./rpy/tests_rpy_classic.py -> build/lib.linux-x86_64-2.6/rpy2
copying ./rpy/tests.py -> build/lib.linux-x86_64-2.6/rpy2
copying ./rpy/rpy_classic.py -> build/lib.linux-x86_64-2.6/rpy2
copying ./rpy/__init__.py -> build/lib.linux-x86_64-2.6/rpy2
creating build/lib.linux-x86_64-2.6/rpy2/rlike
copying ./rpy/rlike/container.py -> build/lib.linux-x86_64-2.6/rpy2/rlike
copying ./rpy/rlike/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/rlike
copying ./rpy/rlike/functional.py -> build/lib.linux-x86_64-2.6/rpy2/rlike
copying ./rpy/rlike/indexing.py -> build/lib.linux-x86_64-2.6/rpy2/rlike
creating build/lib.linux-x86_64-2.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_indexing.py -> build/lib.linux-x86_64-2.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_functional.py -> build/lib.linux-x86_64-2.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_container.py -> build/lib.linux-x86_64-2.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/rlike/tests
creating build/lib.linux-x86_64-2.6/rpy2/rinterface
copying ./rpy/rinterface/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface
creating build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Device.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.linux-x86_64-2.6/rpy2/rinterface/tests
creating build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/numpy2ri.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/help.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/packages.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/robject.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/vectors.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/environments.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/functions.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/conversion.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/constants.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/language.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
copying ./rpy/robjects/methods.py -> build/lib.linux-x86_64-2.6/rpy2/robjects
creating build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testVector.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testArray.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRObject.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFormula.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRobjects.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testLanguage.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testHelp.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testPackages.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testMethods.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFunction.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/tests
creating build/lib.linux-x86_64-2.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/ggplot2.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/grid.py -> build/lib.linux-x86_64-2.6/rpy2/robjects/lib
creating build/lib.linux-x86_64-2.6/rpy2/interactive
copying ./rpy/interactive/process_revents.py -> build/lib.linux-x86_64-2.6/rpy2/interactive
copying ./rpy/interactive/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/interactive
creating build/lib.linux-x86_64-2.6/rpy2/interactive/tests
copying ./rpy/interactive/tests/__init__.py -> build/lib.linux-x86_64-2.6/rpy2/interactive/tests
running build_ext
/usr/local/msg/lib64/R/bin/exec/R: error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "setup.py", line 441, in <module>
    [os.path.join('doc', 'source', 'rpy2_logo.png')])],
  File "/usr/local/msg/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/msg/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/local/msg/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/local/msg/lib/python2.6/distutils/command/install.py", line 577, in run
    self.run_command('build')
  File "/usr/local/msg/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/local/msg/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/local/msg/lib/python2.6/distutils/command/build.py", line 134, in run
    self.run_command(cmd_name)
  File "/usr/local/msg/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/local/msg/lib/python2.6/distutils/dist.py", line 994, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/local/msg/lib/python2.6/distutils/cmd.py", line 117, in ensure_finalized
    self.finalize_options()
  File "setup.py", line 144, in finalize_options
    rversion = get_rversion(r_home)
  File "setup.py", line 186, in get_rversion
    rversion = m.groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'

1 个答案:

答案 0 :(得分:0)

所以我试图在网络驱动器上安装它,但是从我从未安装过R的机器上。当我从正确的机器上安装时,问题就消失了。