我试图在运行Windows 10的机器上安装rpy2。我已经安装了R 3.4.4(64位),并且在RGui中正常工作。然后我尝试使用pip安装rpy2,但是遇到了一个错误,它无法找到R,所以我将c:\ Program Files \ R \ R-3.4.4 \ bin \添加到我的路径环境变量中。现在当我执行
pip install rpy2
我遇到了一个不同的错误:
命令 '('c:\PROGRA~1\R\R-34~1.4\bin\x64\R', 'CMD', 'config', '--ldflags')' 返回了非零的退出状态 1。
下面是完整的输出。你有什么想法我做错了什么吗?
pip install rpy2
Collecting rpy2
Downloading https://files.pythonhosted.org/packages/88/f7/788e5e1587bc1ab48b5b0467f9c3a08ef5aadbd993ed835559a10e452121/rpy2-2.9.3.tar.gz (193kB)
Complete output from command python setup.py egg_info:
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
'sh' is not recognized as an internal or external command,
operable program or batch file.
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
c:\PROGRA~1\R\R-34~1.4\bin\x64\R CMD config --ldflags
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\py\AppData\Local\Temp\pip-build-qz4rb_4o\rpy2\setup.py", line 374, in <module>
ri_ext = getRinterface_ext()
File "C:\Users\py\AppData\Local\Temp\pip-build-qz4rb_4o\rpy2\setup.py", line 269, in getRinterface_ext
ldf = shlex.split(' '.join(rexec.cmd_config('--ldflags')))
File "C:\Users\py\AppData\Local\Temp\pip-build-qz4rb_4o\rpy2\setup.py", line 222, in cmd_config
universal_newlines = True)
File "c:\users\py\miniconda3\lib\subprocess.py", line 626, in check_output
**kwargs).stdout
File "c:\users\py\miniconda3\lib\subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('c:\\PROGRA~1\\R\\R-34~1.4\\bin\\x64\\R', 'CMD', 'config', '--ldflags')' returned non-zero exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\py\AppData\Local\Temp\pip-build-qz4rb_4o\rpy2\
"c:\PROGRA~1\R\R-34~1.4\bin\x64\R" CMD config --ldflags
时,会输出什么?此外,您的Python是64位的吗? - CristiFati1\R\R-341.4\bin\x64\R" CMD config --ldflags 则会显示以下错误信息:'sh' 不是内部或外部命令,也不是可运行的程序或批处理文件。 - pyguy