[R] R unable to locate base unix commands (tar, sh etc)

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Oct 18 05:05:11 CEST 2019


To be clear for the OP... PATH variables on a POSIX platform are separated using the ':' character... on Windows a ';' character is used. This is a user error... your environment variables are messed up... possibly independent of R.

On October 17, 2019 6:14:11 PM PDT, stephen sefick <ssefick using gmail.com> wrote:
>I work on a Mac now. I believe .profile gets sourced first and then
>.bashrc. I set PATH in my .bashrc. I set a git token in .Renviron and a
>blank .Rprofile because I use packrat quite often. I have no problem
>with
>my environment at a shell or in Rstudio.
>
>I would start by commenting where you set the PATH in the multiple
>files
>until you find the order they are sourced. Or look in .profile and
>.bashrc
>to find and replace the semi colons with colons?
>
>I do not understand how a PATH variable would be set in .Rprofile.
>
>I agree with pd about the semicolons.
>
>What happens when you type tar at a command prompt?
>FWIW,
>
>Stephen
>
>On Thu, Oct 17, 2019, 20:13 peter dalgaard <pdalgd using gmail.com> wrote:
>
>> Semicolons in PATH on a Unix derivative like MacOS could well do that
>to
>> you. It is not clear how they got there, but apparently not from your
>> ~/.Environ file. However, multiple settings of the same PATH variable
>in
>> .Environment is not something I'd think would work. Persumably the
>last
>> setting wins, but I'm not sure of that.
>>
>> -pd
>>
>> > On 15 Oct 2019, at 15:09 , gordon beattie <gordo2b using hotmail.co.uk>
>wrote:
>> >
>> > Started having a problem installing packages where R can't find
>base
>> unix commands. I've put an example below (other packages have
>identical
>> "command not found" errors, sometimes with different commands e.g.
>sh) and
>> my PATH/.Renviron(where the problem likely is). I'm on MacOS. Thanks
>in
>> advance for any assistance!
>> >
>> >> install.packages("hdf5r",
>>
>configure.args="--with-hdf5=/usr/local/Cellar/hdf5/1.10.5_1/bin/h5cc")
>> > trying URL '
>>
>https://www.stats.bris.ac.uk/R/bin/macosx/el-capitan/contrib/3.6/hdf5r_1.3.0.tgz
>> '
>> > Content type 'application/x-gzip' length 4332333 bytes (4.1 MB)
>> > ==================================================
>> > downloaded 4.1 MB
>> >
>> > sh: tar: command not found
>> > Error: file
>>
>�/var/folders/ll/jmydhb6n7jqg5rv_c58jxkkh0000gn/T//RtmpnssBh2/downloaded_packages/hdf5r_1.3.0.tgz�
>> is not a macOS binary package
>> > In addition: Warning messages:
>> > 1: In system(paste0("tar zxf \"", path.expand(what), "\" -C \"",
>> path.expand(where),  :
>> >  error in running command
>> > 2: 'tar' returned non-zero exit code 127
>> >
>> > PATH:
>> >
>> >> Sys.getenv("PATH")
>> > [1] "/bin;/usr/bin;/usr/local/bin"
>> >
>> > .Renviron (could anyone explain why "Sys.getenv" doesn't output the
>> contents of Renviron, trying to understand how they link)
>> >
>> > .RenvironR_LIBS=~/R/library
>> > PAGER=/usr/local/bin/less
>> >
>PATH=/Users/gordon.beattie/Downloads/R_packages/gliph-master/gliph/bin
>> > PATH=/usr/local/bin
>> > PATH=/usr/local/bin
>> > PATH=/usr/bin
>> > PATH=/bin
>> > PATH=/usr/sbin
>> > PATH=/sbin
>> > PATH=/Users/gordon.beattie/.virtualenvs/r-reticulate/bin
>> > PATH=/Users/gordon.beattie/.virtualenvs/r-reticulate/bin
>> > PATH=/usr/bin:/bin:/usr/sbin
>> > PATH=/sbin
>> > PATH=/usr/local/bin
>> >
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> --
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: pd.mes using cbs.dk  Priv: PDalgd using gmail.com
>>
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list