Question: Why I can not install anything on R?
0
gravatar for Za
3 days ago by
Za110
Za110 wrote:

Sorry, I asked this question in bioinformatics too and googled a lot but still my problem exists

after updating R, whatever package I am trying to install gives me the same error

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RcppEigen.so] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library/RcppEigen’
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/4v/31py55vj2rlbpy4qcv2gqt2m0000gq/T/RtmpIyjaEZ/downloaded_packages’

How I can install R packages like already please?

R software error • 225 views
ADD COMMENTlink written 3 days ago by Za110

Are you using Rstudio?

ADD REPLYlink written 3 days ago by jrj.healey7.4k

Yes I am using RStudio

ADD REPLYlink written 3 days ago by Za110

Try to purge R completely by running these commands in terminal (not in R).

https://stackoverflow.com/a/24981651/3691040

Also delete the RStudio.app from your Applications.

ADD REPLYlink written 3 days ago by jrj.healey7.4k

Moderator note:

I'm separating out some comment threads to try and stop everything nesting too deeply.

ADD REPLYlink written 3 days ago by jrj.healey7.4k

Sorry what is the solution please?

Thank you

ADD REPLYlink written 3 days ago by Za110

The answer already provided by Genomax and Steve should be fine - they work for most people. As you do not favour the Python solution, you should follow the advice of Genomax.

From your current position, do the following:

  1. Uninstall Microsoft R and standard R (and ensure 100% that they are uninstalled - do not just delete directories)
  2. Download latest version from CRAN and install (pkg file)
  3. Update R Studio (Help > Check for Updates)

Unfortunately, we are all remote from you, so, we cannot see the specific actions that you are taking.

ADD REPLYlink written 3 days ago by Kevin Blighe30k

If you download R separately, it is crucial that it installs to a 'normal' place, so that RStudio can find the R binary. Else you will need to direct RStudio to whereever R is.

This is why I suggest you allow RStudio to do it for you to avoid confusion.

ADD REPLYlink written 3 days ago by jrj.healey7.4k

Sorry I removed everything and I installed latest version of R 3.5.1 that for me did not work so I installed R 3.3.3 but again the same problem

* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** libs
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c aes.c -o aes.o
make: /usr/local/clang4/bin/clang: No such file or directory
make: *** [aes.o] Error 1
ERROR: compilation failed for package ‘digest’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/digest’
Warning in install.packages :
  installation of package ‘digest’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/4v/31py55vj2rlbpy4qcv2gqt2m0000gq/T/RtmpVINAYd/downloaded_packages’
>

I can not install any package yet :( :( :(

ADD REPLYlink written 3 days ago by Za110

You need to install C libraries. Take a look here: https://embeddedartistry.com/blog/2017/2/20/installing-clangllvm-on-osx

ADD REPLYlink written 3 days ago by Kevin Blighe30k

Za : You may be gone for the day but did you install the two tools mentioned in: https://cran.r-project.org/bin/macosx/tools/

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

Thank you, yes, just yesterday as you suggested I installed clang and gfortran my iMAC is Yosemite 10.5.5 and I tried to install the compatible versions but again I am facing

Do you want to install from sources the packages which need compilation?
y/n: y
Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘fansi’ ‘promises’
Do you want to attempt to install these from sources?
y/n: 


make: /usr/local/clang4/bin/clang++: No such file or directory
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp’
ADD REPLYlink written 3 days ago by Za110

You are using a ~ 8+ year old operating system that has not been maintained for a long time. It is quite possible that that could be the root cause of all the issues you have been experiencing.

Are you sure clang was installed without any errors?

ADD REPLYlink written 2 days ago by genomax57k

Sorry, I just double clicked on clang-6.0.0.pkg and installed that. I checked for gcc

eduroam-int-dhcp-97-95-149:~ admin$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
eduroam-int-dhcp-97-95-149:~ admin$

The graphics card of my own mac failed so I transferred my data from failed mac to this mac by a cable;

This is a Yosemite 10.10.5 version mac

Whatever R package I am trying to install if any need to be compiled I will get error

> install.packages("ggplot2")

  There is a binary version available but the source version is later:
        binary source needs_compilation
ggplot2  2.2.1  3.0.0             FALSE

installing the source package ‘ggplot2’

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.0.0.tar.gz'
Content type 'application/x-gzip' length 2847050 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error : object ‘enexprs’ is not exported by 'namespace:rlang'
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/4v/31py55vj2rlbpy4qcv2gqt2m0000gq/T/RtmpAiNK12/downloaded_packages’
>
ADD REPLYlink modified 2 days ago • written 2 days ago by Za110

Looks like you need to install latest version of rlang (https://github.com/tidyverse/ggplot2/issues/2732 ).

This also may be relevant: https://community.rstudio.com/t/unable-to-install-any-packages/13053/3

ADD REPLYlink modified 2 days ago • written 2 days ago by genomax57k
2
gravatar for genomax
3 days ago by
genomax57k
United States
genomax57k wrote:

Since you chose to install Microsoft's version of R for Mac (which apparently is subtly different) you may be running into these things.

Perhaps you should consider getting rid of all older versions of R. Start with a fresh CRAN install of latest R and then reinstall the packages you need.

ADD COMMENTlink written 3 days ago by genomax57k

Thank you, I removed R.framework folder even but again I have R. I don't know how to remove R permanently :(

ADD REPLYlink written 3 days ago by Za110
1

Did you remove all folders starting at R.framework in Frameworks ?

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

Yes I removed R.framework but again

> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.5.1-MRO/Resources/library"
>

I don't know where this R is because in this address I can not locate any R

ADD REPLYlink written 3 days ago by Za110
1

What do you get with which R?

ADD REPLYlink written 3 days ago by genomax57k
> which R
Error: unexpected symbol in "which R"
>
ADD REPLYlink written 3 days ago by Za110
1

Please exit out of R and then run that command on system prompt.

If you had removed every folder under R.framework then there should be no R program on your computer. Which does not seem to be the case.

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

Sorry I am sure I have removed R.framework

But still in terminal I have R 3.5.1 microsoft

Microsoft R Open 3.5.1
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2018 Microsoft Corporation

Multithreaded BLAS/LAPACK libraries detected. Using 2 cores for math algorithms.

Default CRAN mirror snapshot taken on 2018-08-01.
See: https://mran.microsoft.com/.

>
ADD REPLYlink written 3 days ago by Za110
1

Is that what you get when you run which R in plain terminal prompt?

ADD REPLYlink written 3 days ago by genomax57k

Yes @genomax

In terminal

> which R
Error: unexpected symbol in "which R"
>
ADD REPLYlink written 3 days ago by Za110
1

Does your system prompt look like >? That looks to me like the prompt in R which was why I was confused.

What does find /Library/Frameworks/ -name "R.framework" -print show? It should show nothing if you have truly removed all versions of R.

ADD REPLYlink written 3 days ago by genomax57k
> find /Library/Frameworks/ -name "R.framework" -print
Error: unexpected string constant in "find /Library/Frameworks/ -name "R.framework""
>
ADD REPLYlink written 3 days ago by Za110
1

I have a feeling you are still inside a R terminal and not the actual system terminal program. Can you open a fresh terminal window (apple key + space --> terminal --> new terminal window/tab) and run that command?

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

You were right

Last login: Thu Oct 11 17:48:55 on ttys000
eduroam-int-dhcp-97-95-149:~ admin$ find /Library/Frameworks/ -name "R.framework" -print
/Library/Frameworks//R.framework
eduroam-int-dhcp-97-95-149:~ admin$ 

eduroam-int-dhcp-97-95-149:~ admin$ which r
/usr/local/bin/r
eduroam-int-dhcp-97-95-149:~ admin$
ADD REPLYlink modified 3 days ago • written 3 days ago by Za110
2

Looks like you still have the R.framework directory.

Note: Only do the following if you are not tired and can fully concentrate.

sudo mv /Library/Frameworks/R.framework /Library/Frameworks/R.framework.bak

Now grab a new copy of the R installer from CRAN or use the conda alternative below you choice.

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

Thank you, likely I got rid of that annoying R

Last login: Thu Oct 11 18:29:26 on ttys000
eduroam-int-dhcp-97-95-149:~ admin$ sudo mv /Library/Frameworks/R.framework /Library/Frameworks/R.framework.bak
Password:
eduroam-int-dhcp-97-95-149:~ admin$ which r
eduroam-int-dhcp-97-95-149:~ admin$ find /Library/Frameworks/ -name "R.framework" -print
eduroam-int-dhcp-97-95-149:~ admin$
ADD REPLYlink written 3 days ago by Za110

Sorry, I downloaded R from CRAN and installed that but when I am trying to launch RStudio, says that Unable to locate R binary by scanning standard locations

Also in terminal that does not recognise R

eduroam-int-dhcp-97-95-149:~ admin$ r
-bash: r: command not found
eduroam-int-dhcp-97-95-149:~ admin$
ADD REPLYlink modified 3 days ago • written 3 days ago by Za110

Try capital 'R'.

You installed from here: https://cran.r-project.org/bin/macosx/ ?

ADD REPLYlink written 3 days ago by Kevin Blighe30k

Yes I downloaded from where you are pointing and R.frameork folder created and inside that is 3.5

Last login: Thu Oct 11 18:49:46 on ttys000
eduroam-int-dhcp-97-95-149:~ admin$ R
-bash: R: command not found
eduroam-int-dhcp-97-95-149:~ admin$ 


eduroam-int-dhcp-97-95-149:~ admin$ which r
eduroam-int-dhcp-97-95-149:~ admin$
ADD REPLYlink modified 3 days ago • written 3 days ago by Za110

Don't bother. Reinstall RStudio, and let it do it for you. Rstudio will install R at the same time if you take it from their site I believe.

First, purge and R installations you have, so that your new Rstudio install doesnt get confused.

ADD REPLYlink modified 3 days ago • written 3 days ago by jrj.healey7.4k

I reinstalled RStudio right now, When I tried to launch that without being open told

Unable to locate R binary by scanning standard locations
ADD REPLYlink written 3 days ago by Za110

That's probably because you installed R separately from CRAN and it's gone somewhere unusual.

ADD REPLYlink written 3 days ago by jrj.healey7.4k
2
gravatar for steve
3 days ago by
steve1.7k
United States
steve1.7k wrote:

As an alternative, you might try installing R into conda instead (full Anaconda download here, slimmed down Miniconda download here). This has become my preferred method of installing R and its packages, since it is much easier to install and manage specific versions of R and its packages. Here is an example installation command using conda: conda install -y -c r r-base=3.4.3 r=3.4.3 r-reshape2=1.4.3 r-ggplot2=2.2.1. Of course this means you will need to activate conda every time you want to use R, and Google to find if the package you want is available on conda. Looks like the package you are trying to install is available for conda here

ADD COMMENTlink modified 3 days ago • written 3 days ago by steve1.7k

This is _the_ best solution IMO. Much better than the deinstall-reinstall-whyIsntMyProjectWorkingAnymore workflow

ADD REPLYlink written 3 days ago by russhh3.9k
2

Perhaps. But it is going to leave a whole bunch of old crap around. We are in the cleanup phase for now. Once that is done this may be the best way.

ADD REPLYlink modified 3 days ago • written 3 days ago by genomax57k

Sorry but I don't anything in Python and that creates a super courses of error

ADD REPLYlink written 3 days ago by Za110
1

Assuming you are on a Mac or Linux system (appears to be Mac based on your error messages), you don't actually have to mess with any Python stuff to do this if you install conda in batch mode; the command would look something like this: wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh && bash Miniconda3-latest-MacOSX-x86_64.sh -b -p $HOME/conda. This would install a fresh conda in your home directory and will not affect any system Python stuff.

ADD REPLYlink modified 2 days ago • written 2 days ago by steve1.7k

Thank you I installed conda; sorry what is the next step now because I got error when trying to install

Last login: Fri Oct 12 14:37:29 on ttys001
eduroam-int-dhcp-97-95-149:~ admin$ conda install -y -c r r-base=3.4.3 r=3.4.3 r-reshape2=1.4.3 r-ggplot2=2.2.1
-bash: conda: command not found
eduroam-int-dhcp-97-95-149:~ admin$ conda
-bash: conda: command not found
eduroam-int-dhcp-97-95-149:~ admin$ conda install -c conda-forge r-rcppeigen 
-bash: conda: command not found
eduroam-int-dhcp-97-95-149:~ admin$
ADD REPLYlink modified 1 day ago • written 1 day ago by Za110
1
gravatar for genomax
3 days ago by
genomax57k
United States
genomax57k wrote:

Install the fortran libraries/clang package mentioned from the tools page: https://cran.r-project.org/bin/macosx/tools/

ADD COMMENTlink modified 3 days ago • written 3 days ago by genomax57k

Sorry, after installing

fortran libraries/clang package

 > devtools::install_github("rstudio/httpuv")
    Downloading GitHub repo rstudio/httpuv@master
    from URL https://api.github.com/repos/rstudio/httpuv/zipball/master
    Installation failed: Could not find build tools necessary to build httpuv
    > 
    > 
    >
ADD REPLYlink written 3 days ago by Za110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1483 users visited in the last hour