Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R_ext/eventloop.h: No such file error while installing rpy2 using pip

When I try install rpy2 on Windows 10 using

pip install rpy2

I get the following error:

....
....
.\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

Below, you can see all files under the R_ext folder:

enter image description here

As you can see from the screenshot above, there is no such eventloop.h file?

I have the RStudio 3.4.3 version and RTools setup. The environment variables in system path are

  • C:\Rtools\bin
  • C:\Rtools\mingw_32\bin
  • C:\Program Files\R\R-3.4.3\bin\

I am using Python 3.6.4 version.

I really got stuck, don't know what to do. I would appreciate your help.

like image 977
user3288051 Avatar asked Mar 02 '18 19:03

user3288051


1 Answers

Instead of trying to compile the Python library from source code, you can use an Unofficial Windows Binaries for Python Extension Packages.

There is a binary distribution for rpy2.

Download the Wheel file which matches your Python version (3.6) and architecture (64 bits) an run:

pip install rpy2‑2.9.5‑cp36‑cp36m‑win_amd64.whl
like image 200
Laurent LAPORTE Avatar answered Sep 29 '22 12:09

Laurent LAPORTE