Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R Packages gone wonky #36

Open
mattnuttall00 opened this issue Nov 28, 2019 · 4 comments
Open

R Packages gone wonky #36

mattnuttall00 opened this issue Nov 28, 2019 · 4 comments

Comments

@mattnuttall00
Copy link

Hi all,

Yesterday I tried to install a new package, and was confronted with the option:

Do you want to install from sources the packages which need compilation? y/n

I didn't really know what that meant, so I said yes (I now realise that was the incorrect option to choose...). The package appeared to install, but then at the end of some unusual white script (which I was not familiar with when installing a package - I assume related to selecting yes above), I noticed the line:

installation of package had non-zero exit status

I tried to load the package via library(), but I was told that the package didn't exist. So I assumed the installation hadn't worked, but the package was just for interest and not essential to what I was doing, and so I ignored it and carried on with my work. Only to discover that all of the packages I had currently loaded in my R session had stopped working.

So I closed down my Rstudio session, re-opened, and tried to re-load my packages. None of them loaded. So I closed down R studio, opened the R console, and ran update.packages(). I then re-opened R studio, and all of the packages appear to load now, except tidyverse. When I try to load it, I get the following messages:

`ERROR: dependency 'rlang' is not available for package 'lifecycle'

  • removing 'C:/Program Files/R/R-3.4.0/library/lifecycle'
    Warning in install.packages :
    running command '"C:/PROGRA1/R/R-341.0/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.4.0\library" C:\Users\mnn1\AppData\Local\Temp\Rtmp8Q0MBc/downloaded_packages/lifecycle_0.1.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status
    ERROR: dependency 'rlang' is not available for package 'hms'
  • removing 'C:/Program Files/R/R-3.4.0/library/hms'
    Warning in install.packages :
    running command '"C:/PROGRA1/R/R-341.0/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.4.0\library" C:\Users\mnn1\AppData\Local\Temp\Rtmp8Q0MBc/downloaded_packages/hms_0.5.2.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘hms’ had non-zero exit status
    ERROR: dependencies 'dplyr', 'hms', 'purrr', 'rlang', 'tibble', 'tidyr' are not available for package 'tidyverse'
  • removing 'C:/Program Files/R/R-3.4.0/library/tidyverse'
    Warning in install.packages :
    running command '"C:/PROGRA1/R/R-341.0/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.4.0\library" C:\Users\mnn1\AppData\Local\Temp\Rtmp8Q0MBc/downloaded_packages/tidyverse_1.3.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status`

Based on the above, it looks like some of the dependencies are failing to load. I have tried to install some of the mentioned dependencies (for tidyverse) such as dplyr independently, and I keep getting the option: Do you want to install from sources the packages which need compilation? which I have never seen before when installing/loading these packages. I have tried both y and n, and neither option successfully installs the packages.

I'm now out of ideas - this is beyond my knowledge. Any suggestions most welcome!!

Cheers
Matt

@jejoenje
Copy link
Member

Woohoo! Welcome to dependency hell!

Good grief! That is quite a mess indeed! What package was it that you originally tried to install? It certainly doesn't seem to play nice with much other stuff... Did it come from CRAN??

Installing from "sources" just means that you are compiling raw code, as opposed to something that was already compiled for your system (Linux, Windows, Mac, whatever you're running).
Generally speaking that is not a bad idea at all, as you should be getting something that's custom-compiled for your system (and existing package combination). However I suppose there are more things that could go wrong (evidently!) if different combinations with existing packages are a little iffy.
Oopsy!

Anyway, do I understand correctly that currently, everything seems to be working as it should except tidyverse?
If so, I think what I would try first, is to remove it and at least some of its dependencies ('dplyr', 'hms', 'purrr', 'tibble', 'tidyr' - possibly leave 'rlang' unless you really have to remove it).

remove.packages("dplyr")
remove.packages("hms") # etc

Then try to reinstall tidyverse:

install.packages("tidyverse")

If you have to compile from source, do, but that would suggest you have a wider issue, I think.

Have you removed the package that originally messed things up in the first place, by the way? If not, I would start with that.

What version of R are you on? Try sessionInfo().
It may be that actually uninstalling R completely (and remove all packages), reinstalling the latest version, and then installing all your packages again as you need them - especially if you are on an older version of R, that might be the best/easiest way forward?

@mattnuttall00
Copy link
Author

Grrr, how annoying! I can't even remember what the package was, as it's not in my library as it didn't install properly. But it was off GitHib, not CRAN.

I'm on R vers 3.4.0, and I see that the latest version is 3.6.1. Perhaps the simplest thing to do would be to uninstall R and reinstall, and then as you say, just install packages as I go along.

Best way to uninstall R? Do I just run the unins000.exe file in C>Program Files>R>R-3.4.0? Will that get rid of the package library automatically?

Thanks!

@jejoenje
Copy link
Member

Issue with packages off Github (or other sources) is that obvs they haven't gone through all the stringent checks that CRAN imposes. Which are partly to do with exactly these sorts of potential issues...

Yea if you are due an upgrade anyway, I would probably do that. It's not as bad as it sounds. You might as well do RStudio at the same time, too, if you need to.

It's been a while since I have done this on Windows, but I think that as long as you go through the "official" uninstall procedures (probably cleanest to do this through "System > Install remove/Software" or whatever they are calling it now), it should remove everthing correctly. Reboot after you've done it, and check to see if there is anything left in the installation directories - if so, chuck that out too. Then remove RStudio, reboot again, download new versions of both R and RStudio, and install.
Once all is up and running I would probably just install every package one by one as you need it - rather than try to reinstall everthing in one go I mean.

@mattnuttall00
Copy link
Author

OK perfect, I will just do that. It sounds cleaner that trying to faff around with different bits of tidyverse. I could probably use the upgrade anyway!

Thanks @jejoenje !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants