我试图在Python 3.6中的Visual Studio Professional 2017版本15.8.2中安装rpy2,我得到下面看到的egg_info错误。
我已经搜索了类似的问题并且没有运气地遵循他们的建议
我正在运行Windows 10并且没有想法
----- Installing 'rpy2' -----
Collecting rpy2
Using cached https://files.pythonhosted.org/packages/f1/98/c7652cc9d7fc0afce74d2c30a52b9c9ac391713a63d037e4ab8feb56c530/rpy2-2.9.4.tar.gz
Complete output from command python setup.py egg_info:
R version 3.5.1 (2018-07-02) -- "Feather Spray"
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/.
R version 3.5.1 (2018-07-02) -- "Feather Spray"
C:\PROGRA~1\R\R-35~1.1\bin\x64\R CMD config --ldflags
'sh' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ERIKWA~1\AppData\Local\Temp\pip-install-953alcay\rpy2\setup.py", line 374, in <module>
ri_ext = getRinterface_ext()
File "C:\Users\ERIKWA~1\AppData\Local\Temp\pip-install-953alcay\rpy2\setup.py", line 269, in getRinterface_ext
ldf = shlex.split(' '.join(rexec.cmd_config('--ldflags')))
File "C:\Users\ERIKWA~1\AppData\Local\Temp\pip-install-953alcay\rpy2\setup.py", line 222, in cmd_config
universal_newlines = True)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('C:\\PROGRA~1\\R\\R-35~1.1\\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\ERIKWA~1\AppData\Local\Temp\pip-install-953alcay\rpy2\
----- Failed to install 'rpy2' -----
Windows没有sh命令,你只需要安装类似Cygwin的东西来解决这个问题