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

Error in install.packages : object 'needed_packages' not found #21

Open
prestongreene opened this issue Apr 28, 2018 · 12 comments
Open
Labels

Comments

@prestongreene
Copy link

prestongreene commented Apr 28, 2018

After successfully updating R from 3.3. to 3.5 using updateR() from RStudio and selecting "yes" to restarting R, I got the following message:

install.packages(as.vector(needed_packages))
Error in install.packages : object 'needed_packages' not found
R version change [3.3.3 -> 3.5.0] detected when restoring session; search path not restored

It also looks like my old packages are no longer installed.

Here is my sessionInfo():

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0
@cring-toxstrategies
Copy link

I am having exactly the same problem. My sessionInfo() is identical to that listed above. The only difference is that I was upgrading from R version 3.4.3.

Everything went smoothly, R was updated to R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Also the packages installed on your previous version of R were restored
[At this point RStudio told me it was trying to update loaded packages and asked to restart, so I said yes]
Restarting R session...
> install.packages(as.vector(needed_packages))
Error in install.packages : object 'needed_packages' not found
R version change [3.4.3 -> 3.5.0] detected when restoring session; search path not restored

Here's the list of packages that seem to be currently installed after running updateR() -- it seems that the only ones remaining are those that ship with R ("base" or "recommended" priority).

> installed.packages()[, "Priority"]
         base          boot         class       cluster     codetools      compiler 
       "base" "recommended" "recommended" "recommended" "recommended"        "base" 
     datasets       foreign      graphics     grDevices          grid    KernSmooth 
       "base" "recommended"        "base"        "base"        "base" "recommended" 
      lattice          MASS        Matrix       methods          mgcv          nlme 
"recommended" "recommended" "recommended"        "base" "recommended" "recommended" 
         nnet      parallel         rpart       spatial       splines         stats 
"recommended"        "base" "recommended" "recommended"        "base"        "base" 
       stats4      survival         tcltk         tools         utils 
       "base" "recommended"        "base"        "base"        "base"

@AndreaCirilloAC
Copy link
Owner

hi @prestongreene and @cring-toxstrategies , package restoring is one of the last features developed so thank you for the precious feedback. Going to work on this.

@seantma
Copy link

seantma commented Sep 18, 2018

@prestongreene @cring-toxstrategies Have you tried using the plain R app to run updateR() rather thru Rstudio? This solution worked for me as I had similar issues when updating thru Rstudio.

@ogamel
Copy link

ogamel commented Sep 19, 2018

I have the same issue. Any solution?

@LunaSare
Copy link

LunaSare commented Oct 8, 2018

I am also getting an Error in install.packages : object 'needed_packages' not found
when running updateR() in RStudio.
But running it from plain R instead of RStudio worked for me.

@AndreaCirilloAC
Copy link
Owner

thank you @LunaSare @seantma , I am trying to get which is the difference among running updateR() trough R and Rstudio.
Any idea about that?

@fennuluotuo
Copy link

I have the same issue. Any solution?

@debusklaneml
Copy link

debusklaneml commented May 1, 2019

I also had this same problem.

> install.packages(as.vector(needed_packages)) Error in install.packages : object 'needed_packages' not found R version change [3.5.0 -> 3.6.0] detected when restoring session; search path not restored

Obviously, because the new R is installed and this operation failed, my old packages are gone.

@AndreaCirilloAC
Copy link
Owner

AndreaCirilloAC commented May 1, 2019

Hi @fennuluotuo and @debusklaneml . Have you tried the workaround suggested by @seantma ?
Thanks

@AndreaCirilloAC
Copy link
Owner

Plus, I have added a disclaimer on this within the package Readme and will do the same on package loading. Thank you all for pointing this out.

@releesha
Copy link

I had the same problem. First, I tried to install the needed package in plain R then, I do it in RStudio. It worked. Thank you @seantma

@mikeroswell
Copy link

mikeroswell commented Feb 6, 2020

Still running into issues with this, see https://stackoverflow.com/a/38619239/8400969. However, I suspect the package worked, even though I got this Error message, as when I restarted R it had updated to 3.6.2 and it looked like most of my packages survived the update as well.

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

No branches or pull requests

10 participants