title: How to setup environment variable R_user to use rpy2 in python
body: <p>I 'm unable to run rpy2 in python. </p>
  
  <p>with this code</p>
  
  <pre><code> import rpy2.robjects as robjects
  </code></pre>
  
  <p>Here's the full exceptions: </p>
  
  <hr>
  
  <p>RuntimeError: R_USER not defined.</p>
  
  <p>File "d:\py\r\r.python.py", line 1, in </p>
  
  <pre><code>  import rpy2.robjects as robjects
  
  File "c:\Python27\Lib\site-packages\rpy2\robjects\__init__.py", line 17, in &lt;module&gt;
    from rpy2.robjects.robject import RObjectMixin, RObject
  
  File "c:\Python27\Lib\site-packages\rpy2\robjects\robject.py", line 5, in &lt;module&gt;
    rpy2.rinterface.initr()
  </code></pre>
  
  <hr>
  
  <p>I'm using window xp win32 Here're my locations:</p>
  
  <pre><code>C:\Python27\Lib\site-packages\rpy2\robjects\robject.py
  
  C:\Program Files\R\R-2.15.0\bin\i386\R.exe
  
  C:\Python27\python.exe
  </code></pre>