使用R 3.4.1安装rpy2 2.9.0

时间:2017-09-12 09:36:57

标签: python r pip rpy2

我使用WinPython将rpy2升级到版本2.9.0,并且有点卡住了。这是我得到的错误(在几十个warning C4068: unknown pragma之后)

.\rpy\rinterface\_rinterface.c(70): fatal error C1083: Cannot open include file: 'R_ext/eventloop.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

我搜索了一下,发现"自R 3.4.0以来,Windows上不再安装仅限Unix的设施R_ext/GetX11Image.hR_ext/QuartzDevice.hR_ext/eventloop.h的标头34; (https://www.r-statistics.com/2017/04/r-3-4-0-is-released-with-new-speed-upgrades-and-bug-fixes/)。

所以我从R源代码中获取了这些头文件并再次尝试,得到其他错误:

 .\rpy\rinterface\_rinterface.c(205): error C2370: 'NAInteger_Type': redefinition; different storage class
c:\users\ac32967\appdata\local\temp\pip-build-mtbg034f\rpy2\rpy\rinterface\na_values.c(135): note: see declaration of 'NAInteger_Type'
.\rpy\rinterface\_rinterface.c(208): error C2370: 'NALogical_Type': redefinition; different storage class
c:\users\ac32967\appdata\local\temp\pip-build-mtbg034f\rpy2\rpy\rinterface\na_values.c(301): note: see declaration of 'NALogical_Type'
.\rpy\rinterface\_rinterface.c(211): error C2370: 'NAReal_Type': redefinition; different storage class
c:\users\ac32967\appdata\local\temp\pip-build-mtbg034f\rpy2\rpy\rinterface\na_values.c(455): note: see declaration of 'NAReal_Type'
.\rpy\rinterface\_rinterface.c(214): error C2370: 'NAComplex_Type': redefinition; different storage class
c:\users\ac32967\appdata\local\temp\pip-build-mtbg034f\rpy2\rpy\rinterface\na_values.c(669): note: see declaration of 'NAComplex_Type'
.\rpy\rinterface\_rinterface.c(217): error C2370: 'NACharacter_Type': redefinition; different storage class
c:\users\ac32967\appdata\local\temp\pip-build-mtbg034f\rpy2\rpy\rinterface\na_values.c(536): note: see declaration of 'NACharacter_Type'
.\rpy\rinterface\_rinterface.c(568): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
.\rpy\rinterface\_rinterface.c(763): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
.\rpy\rinterface\_rinterface.c(954): warning C4013: 'jump_to_toplevel' undefined; assuming extern returning int
.\rpy\rinterface\_rinterface.c(1168): error C2057: expected constant expression
.\rpy\rinterface\_rinterface.c(1168): error C2466: cannot allocate an array of constant size 0
.\rpy\rinterface\_rinterface.c(1168): error C2133: 'options': unknown size
.\rpy\rinterface\_rinterface.c(1191): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
.\rpy\rinterface\_rinterface.c(1199): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
.\rpy\rinterface\_rinterface.c(1201): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
.\rpy\rinterface\_rinterface.c(1203): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
.\rpy\rinterface\_rinterface.c(1204): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
.\rpy\rinterface\_rinterface.c(1211): warning C4028: formal parameter 2 different from declaration
.\rpy\rinterface\_rinterface.c(1218): error C2039: 'ResetConsole': is not a member of 'structRstart'
C:/Environments/R/R-3.4.1/include\R_ext/RStartup.h(68): note: see declaration of 'structRstart'
.\rpy\rinterface\_rinterface.c(1219): warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'blah3'
.\rpy\rinterface\_rinterface.c(1235): warning C4244: 'function': conversion from 'const Py_ssize_t' to 'int', possible loss of data
.\rpy\rinterface\_rinterface.c(1615): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
.\rpy\rinterface\_rinterface.c(1717): warning C4133: '=': incompatible types - from 'SEXP' to 'const char *'
.\rpy\rinterface\_rinterface.c(1718): warning C4090: 'function': different 'const' qualifiers
.\rpy\rinterface\_rinterface.c(2870): warning C4028: formal parameter 2 different from declaration
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

想法?我看到版本不匹配,我想我的R安装需要正确的标题,但无法在任何地方找到它们。

0 个答案:

没有答案