Rstudio中的Source.bashrc
我刚刚在Ubuntu 18.04 LTS中本地安装了一些Perl模块 当像这样使用RStudio服务器呼叫他们时Rstudio中的Source.bashrc,r,perl,ubuntu,perl-module,rstudio-server,R,Perl,Ubuntu,Perl Module,Rstudio Server,我刚刚在Ubuntu 18.04 LTS中本地安装了一些Perl模块 当像这样使用RStudio服务器呼叫他们时 system("perl -MBio::TreeIO -e 1") 我得到以下错误 在@INC中找不到Bio/TreeIO.pm(您可能需要安装Bio::TreeIO模块)(@INC contains:/etc/perl/usr/local/lib/x86_64-linux-gnu/perl/5.26.1/usr/local/share/perl/5.26.1/usr/lib/x8
system("perl -MBio::TreeIO -e 1")
我得到以下错误
在@INC中找不到Bio/TreeIO.pm(您可能需要安装Bio::TreeIO模块)(@INC contains:/etc/perl/usr/local/lib/x86_64-linux-gnu/perl/5.26.1/usr/local/share/perl/5.26.1/usr/lib/x86_64-linux-gnu/usr/share/perl5/usr/x86_64-linux-gnu/perl/5.26/usr/share/perl/5.26/usr/local/lib/lib/site_perl/usr/lib/x86_64-linux-gnu/base)
当我source~/.bashrc
在终端中时,一切正常
我尝试创建一个~/.Rprofile
,其中包含:
system(". ~/.bashrc")
但是不好。根据文档,通过在R shell中运行
帮助(启动)
访问,您应该在主目录中创建一个文件.Renviron
,启动新的R会话时将读取该文件。例如:
.Renviron
FOOBAR=/foo/bar/foo/bar
R外壳
R
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
> cat(Sys.getenv("FOOBAR"), "\n")
/foo/bar/foo/bar
因此,只需将
PERL5LIB
变量设置为本地perl软件包安装目录,创建.Renviron
文件。听起来,用于安装模块的perl与RStudio用于运行命令的perl不同。.bashrc
中是否有任何更改.bashrc
n您应该使用与RStudio相同的perl。这将是一个良好的开端。