我想在我的Windows机器上安装rpy2,但它给了我以下著名的错误:
self.convert_pycparser_error(e, csource)
File "c:\users\96171\appdata\local\temp\pip-install-lxsxk7q4\rpy2\.eggs\cffi-1.14.0-py3.6-win-amd64.egg\cffi\cparser.py", line 336, in convert_pycparser_error
raise CDefError(msg)
cffi.CDefError: cannot parse "void __cffi_extern_python_start; void _capsule_finalizer(SEXP); void __cffi_extern_python_stop;"
<cdef source string>:495:96: Illegal character '\r'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\96171\AppData\Local\Temp\pip-install-lxsxk7q4\rpy2\
我已经完成了以下工作:
- 升级设置工具
- 将pip升级到最新版本
我从此链接下载了如下wheel:
rpy2‑2.9.5‑cp37‑cp37m‑win_amd64.whl
,但我仍然遇到麻烦;我按照以下步骤进行操作:
- 在下载wheel的目录中以管理员身份打开cmd
- 设置
%R_USER%
为我的用户名,如下所示: R_USER C:\Users\my_username 但是我收到以下错误信息:
ERROR: rpy2-2.9.5-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Rpy2(已停止使用,不稳定):提供访问用于统计计算和图形的R软件环境。需要R 3.3,而我在我的系统上使用的是R 3.6.2。这导致错误吗?