Skip to content

Unable to load the package #685

Closed
Closed

Description

@kchen96

I installed the package from Bioconductor but wasn't able to load the package. I am using R version 4.0.3. I did:

BiocManager::install("ComplexHeatmap") library(ComplexHeatmap)

And I got this error message:

Error: package or namespace load failed for ‘ComplexHeatmap’: .onLoad failed in loadNamespace() for 'Cairo', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so': dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so Reason: image not found

Activity

  1. bersbersbers commented on Feb 12, 2021

    @bersbersbers

    Your installation of R seems to be missing the cairo library. This is listed as one of the imports at https://www.bioconductor.org/packages/release/bioc/html/ComplexHeatmap.html. You may need to provide more information on your environment, such as did you compile R yourself, or did you install it as a package?

  2. jokergoo commented on Feb 12, 2021

    @jokergoo
    Owner
  3. kchen96 commented on Feb 12, 2021

    @kchen96
    Author
  4. emilyvansyoc commented on Jun 3, 2021

    @emilyvansyoc

    FYI, I am getting the same error although I have used the ComplexHeatmap package before... Is this related to upgrading to R 4.0?

  5. jokergoo commented on Jun 3, 2021

    @jokergoo
    Owner

    I think it is related to the update of Cairo package or libcairo library.

    If you don't want to update these packages. You explicitly add raster_device = 'png'. Cairo is only used when the matrix is large.

  6. emilyvansyoc commented on Jun 3, 2021

    @emilyvansyoc

    Well my current issue is that I can't load the ComplexHeatmap package... getting the same error message as the first post above:

    require(Cairo)
    Loading required package: Cairo
    Error: package or namespace load failed for ‘Cairo’:
    .onLoad failed in loadNamespace() for 'Cairo', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so':
    dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
    Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so
    Reason: image not found
    Warning message:
    package ‘Cairo’ was built under R version 4.0.2

  7. emilyvansyoc commented on Jun 3, 2021

    @emilyvansyoc

    Whoops - this one

    require(ComplexHeatmap)
    Loading required package: ComplexHeatmap
    Error: package or namespace load failed for ‘ComplexHeatmap’:
    .onLoad failed in loadNamespace() for 'Cairo', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so':
    dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
    Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so
    Reason: image not found
    Warning message:
    package ‘ComplexHeatmap’ was built under R version 4.0.3

  8. jokergoo commented on Jun 3, 2021

    @jokergoo
    Owner

    Then I think you just simply install a new version of XQuartz and restart your R session.

    https://izziswift.com/include-cairo-r-on-a-mac/

  9. emilyvansyoc commented on Jun 3, 2021

    @emilyvansyoc

    Okay, that worked! Up and running. Thanks for the fast reply! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions