Everaldo Aguiar
Everaldo Aguiar

Reputation: 4126

rpy2 installation error on Windows 8 (Anaconda)

I have the latest Anaconda Python distribution installed on Windows 8 and I am attempting to install the rpy2 package. I initially ran into several issues that I was able to circumvent but I'm now stuck on one particular error that I'm pasting below.

The command

pip install rpy2

exits with the following error message:

In file included from .\rpy\rinterface\_rinterface.c:58:0:

.\rpy\rinterface\_rinterface.h:8:15: fatal error: R.h: No such file or
directory

compilation terminated.

error: command 'gcc' failed with exit status 1

Any suggestions? The path to R.h is included on my environment.

Upvotes: 4

Views: 2204

Answers (1)

CT Zhu
CT Zhu

Reputation: 54330

Dr. Gohlke's binary is probably the easiest solution. But you need to change the Python installation path in your registry for this method to work. The relevant key is in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath. Change it so that the anaconda Python is the default python installation. You can always change it back if you want.

Upvotes: 5

Related Questions