I am trying to install rpy2 from a downloaded source archive 'rpy2-2.2.1.tar.gz'. I have been following the installation instructions provided from the rpy2 documentation. This is what I am doing:
tar -xzf rpy2-2.2.1.tar.gz
cd ~/Desktop/rpy2-2.2.1
python setup.py build install
And here is the output in terminal of the attempt:
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
c开发者_JAVA百科opying ./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
in string
If the make
command is missing, chances are you need to install the Apple Xcode Developer Tools. There should be an installer for Xcode 3 somewhere on the DVD or other material that came with your Mac or copy of OS X 10.6. Or you can download it from the Apple Developer Connection website (free membership required). Or you can purchase Xcode 4 from the Mac App Store.
I am receiving the same error. But I am using the Easy_install. The Setup.py is what is generating the error. I only got a brief chance to examine the setup.py file last night, but I think I have figured it out.
This is what I am pursuing right now. The newest version of R, 2.13.1, appears to have added an additional directory layer to the R_Home Path. I suspect that the setup.py for the rpy2 is not expecting this difference and is not able to get past it. I will be investigating this today.
If it is the case, then I will follow this answer up with my actual fixes and the changed setup.py file.
精彩评论