当我尝试在 Windows 10 上安装 rpy2 时
pip install rpy2
我收到以下错误:
....
....
.\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\\cl.exe' failed with exit status 2
在下方,可以看到R_ext文件夹下的所有文件:
从上面的截图可以看出,没有这个eventloop.h这个文件?
我有 RStudio 3.4.3 版本和 RTools 安装程序。系统路径中的环境变量为
- C:\Rtools\bin
- C:\Rtools\mingw_32\bin
- C:\Program Files\R\R-3.4.3\bin\
我使用的是 Python 3.6.4 版本。
我真的卡住了,不知道该怎么办。非常感谢您的帮助。
最佳答案
您可以使用 Unofficial Windows Binaries for Python Extension Packages 而不是尝试从源代码编译 Python 库。 .
rpy2 有一个二进制分布.
下载与您的 Python 版本 (3.6) 和架构(64 位)匹配的 Wheel 文件并运行:
pip install rpy2‑2.9.5‑cp36‑cp36m‑win_amd64.whl
关于python - R_ext/事件循环.h : No such file error while installing rpy2 using pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49075909/