0

I've attempted to load up my rstudio after some maintenance work was carried out on the system and none of my packages were installed. Everything points back to renv not being available! When I try to run my Rmd I get the following error after trying to install the necessary packages:

** Installing R Package Dependencies for R Markdown: 'base64enc', 'digest', 'evaluate', 'glue', 'highr', 'htmltools', 'jsonlite', 'knitr', 'magrittr', 'markdown', 'mime', 'rmarkdown', 'stringi', 'stringr', 'xfun', 'yaml'
[1/22] Installing base64enc...
Error in loadNamespace(x) : there is no package called ‘renv’
Calls: sourceWithProgress ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted

Then trying to install renv goes about as well:

> install.packages('renv')
Error in renv_scope_rtools() : 
  could not find function "renv_scope_rtools"
Error in loadNamespace(x) : there is no package called ‘renv’

I've tried renv::init() and renv::status() and they both return that there is no package called renv!! I've also tried resetting my R completely which hasn't worked.

I cant run anything and I need to be up and running by tomorrow.. please help!!

Phil
  • 7,287
  • 3
  • 36
  • 66
  • I am wondering if there are perhaps artefacts from a previous renv snapshot that are interfering with your attempts to install rmarkdown? Perhaps you can try to locate and delete any `renv.lock` file that may be in your working directory and then attempt to `install.packages('rmarkdown')` again? – br00t Nov 30 '22 at 14:14
  • Do you have an `.Rprofile` file set up to auto run some code perhaps? Maybe that still assumes that `renv` is there. After you run `install.packages('renv')` and get the error, what is the output of `traceback()`? It looks like something has altered the default `install.packages` method. – MrFlick Nov 30 '22 at 15:00

0 Answers0