在Mac OS X 10.6.8上安装rpy2 2.2.1时出错

时间:2011-06-29 22:54:50

标签: macos rpy2

我正在尝试从下载的源档案'rpy2-2.2.1.tar.gz'安装rpy2。我一直在遵循rpy2 documentation提供的安装说明。这就是我在做的事情:

    tar -xzf rpy2-2.2.1.tar.gz
    cd ~/Desktop/rpy2-2.2.1
    python setup.py build install

以下是尝试终端的输出:

    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-2.7
    creating build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/rpy_classic.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/tests.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/tests_rpy_classic.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/container.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/functional.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/indexing.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_container.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_functional.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_indexing.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rinterface
    copying ./rpy/rinterface/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Device.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/constants.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/conversion.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/environments.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/functions.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/help.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/language.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/methods.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/numpy2ri.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/packages.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/robject.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/vectors.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testArray.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFormula.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFunction.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testHelp.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testLanguage.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testMethods.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testPackages.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRObject.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRobjects.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testVector.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/ggplot2.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/grid.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    creating build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    copying ./rpy/interactive/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    copying ./rpy/interactive/process_revents.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    creating build/lib.macosx-10.6-intel-2.7/rpy2/interactive/tests
    copying ./rpy/interactive/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive/tests
    running build_ext
    /Library/Frameworks/R.framework/Resources/bin/config: line 142: make: command not found
    /Library/Frameworks/R.framework/Resources/bin/config: line 143: make: command not found
    R was not built as a library
    Traceback (most recent call last):
      File "setup.py", line 441, in <module>
        [os.path.join('doc', 'source', 'rpy2_logo.png')])],
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
        cmd_obj.ensure_finalized()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "setup.py", line 152, in finalize_options
        config += get_rconfig(r_home, about)
      File "setup.py", line 312, in get_rconfig
        rc = RConfig.from_string(rconfig, allow_empty = allow_empty)
      File "setup.py", line 272, in from_string
        + '\nin string\n' + string)
    ValueError: Invalid substring
字符串

中的

2 个答案:

答案 0 :(得分:1)

如果缺少make命令,则可能需要安装Apple Xcode开发人员工具。应该在DVD或Mac附带的其他材料或OS X 10.6副本的某处安装Xcode 3。或者您可以从Apple Developer Connection网站下载(需要免费会员资格)。或者您可以从Mac App Store购买Xcode 4。

答案 1 :(得分:1)

我收到同样的错误。但我正在使用Easy_install。 Setup.py是生成错误的原因。我昨晚才有机会查看setup.py文件,但我想我已经弄明白了。

这就是我现在正在追求的目标。 R,2.13.1的最新版本似乎在R_Home路径中添加了一个额外的目录层。我怀疑rpy2的setup.py没有预料到这种差异,也无法超越它。我今天将调查此事。

如果是这种情况,那么我将按照我的实际修复和更改的setup.py文件来回答这个问题。