使用自定义 R 安装安装 rpy2
Install rpy2 with custom R installation
我在
中自定义安装了 R
~/R-3.2.2/bin/
当我运行
sudo pip install rpy2
我明白了
Warning: Tried to guess R's HOME but no command (R) in the PATH.
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 330, in <module>
ri_ext = getRinterface_ext()
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 231, in getRinterface_ext
r_home = _get_r_home()
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 63, in _get_r_home
r_home = r_home.split(os.linesep)
UnboundLocalError: local variable 'r_home' referenced before assignment
我没有找到这个问题的答案,尽管它出现在几个帖子中。这是我试过的
将 R 可执行文件添加到 PATH
export PATH=$PATH:/home/R-3.2.2/bin/
没用
导出具有相同值的 R_HOME:无效
echo export PATH=$PATH:/home/R-3.2.2/bin/ >> ~/.bashrc
source ~/.bashrc
没用。
另一方面,"problem"似乎在这里解决了
https://bitbucket.org/rpy2/rpy2/issues/283/rpy2-installation-error-when-r-output
如何正确安装rpy2?
错误是由于 issue in rpy2(刚刚修复)。
否则,可能是因为 R 不在您认为的 PATH 中,或者可能是您没有 运行 它的权限。
尝试:
# assert that the R executable is where you think it is
~/R-3.2.2/bin/R --version
# set the PATH
export PATH=${PATH}:~/R-3.2.2/bin/
# unset R_HOME if needed
unset R_HOME
# install rpy2
pip install rpy2
我在
中自定义安装了 R~/R-3.2.2/bin/
当我运行
sudo pip install rpy2
我明白了
Warning: Tried to guess R's HOME but no command (R) in the PATH.
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 330, in <module>
ri_ext = getRinterface_ext()
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 231, in getRinterface_ext
r_home = _get_r_home()
File "/tmp/pip-build-ITKmkR/rpy2/setup.py", line 63, in _get_r_home
r_home = r_home.split(os.linesep)
UnboundLocalError: local variable 'r_home' referenced before assignment
我没有找到这个问题的答案,尽管它出现在几个帖子中。这是我试过的
将 R 可执行文件添加到 PATH
export PATH=$PATH:/home/R-3.2.2/bin/ 没用
导出具有相同值的 R_HOME:无效
echo export PATH=$PATH:/home/R-3.2.2/bin/ >> ~/.bashrc source ~/.bashrc
没用。
另一方面,"problem"似乎在这里解决了 https://bitbucket.org/rpy2/rpy2/issues/283/rpy2-installation-error-when-r-output
如何正确安装rpy2?
错误是由于 issue in rpy2(刚刚修复)。 否则,可能是因为 R 不在您认为的 PATH 中,或者可能是您没有 运行 它的权限。
尝试:
# assert that the R executable is where you think it is
~/R-3.2.2/bin/R --version
# set the PATH
export PATH=${PATH}:~/R-3.2.2/bin/
# unset R_HOME if needed
unset R_HOME
# install rpy2
pip install rpy2