How to setup environment variable R_user to use rpy2 in python

前端 未结 6 1185
暗喜
暗喜 2020-11-28 08:43

I \'m unable to run rpy2 in python.

with this code

 import rpy2.robjects as robjects

Here\'s the full exceptions:


R

6条回答
  •  盖世英雄少女心
    2020-11-28 09:27

    Here is the way I fixed my R package version 3.0.2 python version 2.7 platform ipython notebook.

    Change Path for R computer-> property -> advanced and system setting -> environment variables

    in the user variable field add C:\Program Files\R\R-3.0.2\bin\x64 (my system is windows 64bit) to path

    In the system variable field add two new variables

    R_HOME c:\program files\r\r-3.0.2

    R_USER C:\Users\"your user name"\Anaconda\Lib\site-packages\rpy2

提交回复
热议问题