I'm having trouble loading the 'flextable' package.

I've come across a few proposed solutions on stackoverflow and in github issues, but I haven't been able to find a solution to the error that I get when installing 'flextable':

Error: package or namespace load failed for ‘flextable’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so':
  dlopen(/Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
  Referenced from: /Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so
  Reason: Incompatible library version: systemfonts.so requires version 19.0.0 or later, but libfreetype.6.dylib provides version 18.0.0

I noticed that this issue has been raised in the Rstudio community before:

I tried:

  • reinstalling XQuartz
  • brew installing cairo and pkg-config
  • install.packages('zip') and restarting Rstudio
  • install.packages("gdtools", type = "source"), although this throws an error for me:
  • ERROR: lazy loading failed for package ‘gdtools’

I can successfully install flextable via install.packages, but it won't load with library().

Any help?

Have you tried reinstalling systemfonts package? Or installing the development version from GitHub? Since from your error message it seems like you need an updated version of that package.

Yes, installed the systemfonts package. I've also tried installing the development version, but I get an error when installing it that way:

Downloading GitHub repo davidgohel/flextable@master
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/davidgohel/flextable/tarball/master'

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.