在 Mac OS X 10.6.8 上安装 rpy2 2.2.1 时出错
我正在尝试从下载的源存档“rpy2-2.2.1.tar.gz”安装 rpy2。我一直遵循 rpy2 文档。这就是我正在做的:
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
在字符串中
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
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
in string
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果缺少
make
命令,您可能需要安装 Apple Xcode 开发工具。 Mac 或 OS X 10.6 副本附带的 DVD 或其他材料上应该有 Xcode 3 安装程序。或者您可以从 Apple Developer Connection 网站下载(需要免费会员)。或者您可以从 Mac App Store 购买 Xcode 4。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.我收到同样的错误。但我使用的是Easy_install。 setup.py 是生成错误的原因。昨晚我只有短暂的机会检查 setup.py 文件,但我想我已经弄清楚了。
这就是我现在所追求的。 R 的最新版本 2.13.1 似乎在 R_Home 路径中添加了一个额外的目录层。我怀疑 rpy2 的 setup.py 没有预料到这种差异,并且无法克服它。今天我将对此进行调查。
如果是这种情况,那么我将根据我的实际修复和更改后的 setup.py 文件来跟进这个答案。
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.