Error when starting Rstudio "there is no package 'yaml'"

rstudio
yaml

#1

Hi, every time I start Rstudio (version 1.1.383) running R version 3.4.3, I get an error appearing twice:

“Error in loadNamespace(name) : there is no package called ‘yaml’”

This error appears in the lines ABOVE the first console chevron i.e. it’s not caused by anything I have done, it shows up automatically when I start Rstudio. I did find the package called ‘yaml’ and install it but that didn’t make any difference, didn’t get rid of the error message.

The error is definitely an Rstudio error, because when I opened R standalone there was no error.


#2

This happened to me when I updated yaml and yaml dependencies while, unknowingly, having an R notebook open.

What worked for me was going to the document folder that stores the packages, which you can locate by doing

.libPaths()

and then simply deleting the yaml folder there. After that you should be able start a fresh RStudio session using Ctrl + Shift + F10 (or Cmd + Shift + F10 on mac) and simply reinstalling yaml.

install.packages("yaml") 

#3

Thanks.
This approach worked for me.


#4

Hi,

I do not find yaml folder in the specified folder and I cant install it either.
Could you help me please?


#5

The same happens to me: when I open RStudio I get 4 lines with the same message: Error in loadNamespace(name) : there is no package called ‘yaml’
I tried to knit an .Rmd and RStudio says that I need an updated version of the package yaml, and ask to me if I want to install it. I answered yes, the instalation starts but at the end Iget the following message:
The downloaded source packages are in
‘C:\Users\perezp\AppData\Local\Temp\RtmpaSD7LQ\downloaded_packages’
Error in loadNamespace(name) : there is no package called ‘yaml’
Error in loadNamespace(name) : there is no package called ‘yaml’
Error in loadNamespace(name) : there is no package called ‘yaml’
Error in loadNamespace(name) : there is no package called ‘yaml’

Any help? Thanks in advance

PS:
Session info -----------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, mingw32
ui RStudio (1.1.419)
language (EN)
collate Spanish_Spain.1252


#6

I have tried again to install the pkg "yaml", but this time from R, not from RStudio, and it has been installed.
At least for me, the problem is solved


#7

If it persists after trying the earlier provided, just upgrade R.
I resolved it by removing/uninstalling R completely coz I could not manage to manually extract to the R folder every package I needed.

Good luck


#8

For what it's worth, the issue with RStudio inadvertently loading the yaml package on startup should be resolved in the daily builds of RStudio:

https://dailies.rstudio.com

We hope to promote the v1.2 branch to a preview release in the near future, so we'd definitely appreciate it if you can take the time to give it a download and see if the issue is resolved.


#9

A potentially easier solution than uninstalling and reinstalling R would be to go to your package library folder and delete the yaml folder. Then in R, rerun the install.packages("yaml") function.


#10

I uninstalled R 3.4.4 and installed R 3.5 and my problem was solved.


#11

I ended up losing a few hours of work today to this issue (trying to knit an Rmd file I created on OS X on a Windows 10 laptop, running R 3.5.0). At first, I was getting "yaml could not be parsed" errors, which I thought were due to some character encoding issues.

It was only after coming across this thread did I try restarting RStudio without loading an Rmd file -- and I still got yaml errors. Weird.

I updated to the latest daily release and the issue was resolved.

One oddity I have noticed is even after running install.packages("yaml", dep=T) and the package getting reinstalled, it does not appear in my packages list in RStudio. Is this normal?


#12

As a follow-up, on the Windows laptop, I tried creating a new RMarkdown document, and RStudio could not find the package. I entered an infinite loop of downloading and not loading yaml.

I ended up checking my library directory and yaml was there... I moved it to where the base R packages live and now yaml shows up in my installed packages list in RStudio and loads properly when called.


#13

Just adding my two cents:

For me, simply upgrading Rstudio to the latest version worked (I don't have R 3.5 yet). Of course, once you launch the newest Rstudio after install, simply execute (as usual):

install.packages("yaml")

#14

This topic has been closed.

If you have a query related to it or one of the replies, start a new topic and refer back to here with a link.