【发布时间】:2019-01-05 05:52:48
【问题描述】:
我的系统中安装了 ubuntu 的默认 python 和 Anaconda Python。当我在 R 中运行系统命令时:
> system('which python')
/usr/bin/python
但是从外壳:
user@user:~/Documents/Rad/jee/Solver$ which python
/home/user/anaconda2/bin/python
同样来自 Rscript 命令行模式:
user@user:~/Documents/Rad/jee/Solver$ Rscript -e "system('which python')"
/home/user/anaconda2/bin/python
R 系统命令中可能有什么不同以提供不同的输出。
【问题讨论】:
-
PATH环境变量不同。 -
谢谢@OrtomalaLokni