Forum Discussion

CanadianAnalyst's avatar
CanadianAnalyst
Frequent Visitor
6 years ago
Solved

Unable to load winCairo.dll

Hi, I'm trying to use custom R visualizations for Power BI desktop, but I'm getting an error code no matter what kind of visualizations I've tried to create.

 

My code works in Rstudio so this is power BI specific. I've tried doing visuals in different libraries (wordcloud and ggplot2) as well as basic plot() and the issue persists. I'm also able to import datasets using R scripts correctly, so some code is working, just not visuals.

 

I've also tried downloading cairo.dll from a different R build into my "C:/ProgramData/Anaconda3/Lib/R/library/grDevices/libs/x64/" folder, but that didn't work either.

 

Please help!

 

Feedback Type:
Frown (Error)

Timestamp:
2019-11-18T16:18:12.4702801Z

Local Time:
2019-11-18T11:18:12.4702801-05:00

Session ID:
77d3cd18-a91a-4310-91c0-0df48d8843c3

Release:
September 2019

Product Version:
2.73.5586.1101 (19.09) (x64)

Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: R script error.
Unable to load 'C:/ProgramData/Anaconda3/Lib/R/library/grDevices/libs/x64/winCairo.dll'
Error in png(filename = rScriptWrapper_currFilename, width = round(573.935309973046/72, :
unable to load winCairo.dll: was it built?
Calls: plot -> plot.default -> dev.hold -> <Anonymous> -> png
Execution halted
---> Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException: R script error.
Unable to load 'C:/ProgramData/Anaconda3/Lib/R/library/grDevices/libs/x64/winCairo.dll'
Error in png(filename = rScriptWrapper_currFilename, width = round(573.935309973046/72, :
unable to load winCairo.dll: was it built?
Calls: plot -> plot.default -> dev.hold -> <Anonymous> -> png
Execution halted

at Microsoft.PowerBI.Scripting.R.RScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)
at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
--- End of inner exception stack trace ---
at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode& serviceErrorStatusCode, CancellationToken cancelToken)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)

OS Version:
Microsoft Windows NT 10.0.16299.0 (x64 en-US)

CLR Version:
4.7 or later [Release Number = 461308]

Peak Virtual Memory:
34.4 GB

Private Memory:
561 MB

Peak Working Set:
699 MB

IE Version:
11.1421.16299.0

User ID:
10884108-ee41-4f34-8398-2b39a04f66b5

Workbook Package Info:
1* - en-CA, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.

Telemetry Enabled:
True

Model Default Mode:
Import

Snapshot Trace Logs:
C:\Users\jlachanc\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot1865582423.zip

Enabled Preview Features:
PBI_shapeMapVisualEnabled

Disabled Preview Features:
PBI_SpanishLinguisticsEnabled
PBI_NewWebTableInference
PBI_showIncrementalRefreshPolicy
PBI_qnaLiveConnect
PBI_userFavoriteResourcePackagesEnabled
PBI_tenantOutOfBoxVisualsEnabled
PBI_personalVisualizationPaneEnabled

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
100%

Supported Services:
Power BI

  • Anonymous's avatar
    Anonymous
    6 years ago

    HI CanadianAnalyst ,

    It seems like you are working with libraries of external devices, I'd like to suggest you take a look at the limits of use R script in power bi R visual:

    Create Power BI visuals using R#known-limitations 

    Known limitations

    R visuals in Power BI Desktop have the following limitations:

    • Data sizes: Data used by an R visual for plotting is limited to 150,000 rows. If more than 150,000 rows are selected, only the top 150,000 rows are used and a message is displayed on the image.

    • Calculation times: If an R visual calculation exceeds five minutes, it causes a time-out error.

    • Relationships: As with other Power BI Desktop visuals, if data fields from different tables with no defined relationship between them are selected, an error occurs.

    • Refreshes: R visuals are refreshed upon data updates, filtering, and highlighting. However, the image itself isn't interactive and can't be the source of cross-filtering.

    • Highlights: R visuals respond if you highlight other visuals, but you can't select elements in the R visual to cross filter other elements.

    • Display devices: Only plots that are plotted to the R default display device are displayed correctly on the canvas. Avoid explicitly using a different R display device.

    • RRO installations: In this release, the 32-bit version of Power BI Desktop doesn't automatically identify RRO installations; you must manually provide the path to the R installation directory in Options and settings > Options > R Scripting.

    Regards,

    Xiaoxin Sheng

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI CanadianAnalyst ,

    According to your error message, it seems more related to r package libraries. Have you tried to check your library status if it compatible with current version of r visual? (you can code your script to rstudio to confirm your library status)
    Regards,

    Xiaoxin Sheng

    • CanadianAnalyst's avatar
      CanadianAnalyst
      Frequent Visitor

      My code works in Rstudio. I'm not sure what you mean by library status?

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI CanadianAnalyst ,

        It seems like you are working with libraries of external devices, I'd like to suggest you take a look at the limits of use R script in power bi R visual:

        Create Power BI visuals using R#known-limitations 

        Known limitations

        R visuals in Power BI Desktop have the following limitations:

        • Data sizes: Data used by an R visual for plotting is limited to 150,000 rows. If more than 150,000 rows are selected, only the top 150,000 rows are used and a message is displayed on the image.

        • Calculation times: If an R visual calculation exceeds five minutes, it causes a time-out error.

        • Relationships: As with other Power BI Desktop visuals, if data fields from different tables with no defined relationship between them are selected, an error occurs.

        • Refreshes: R visuals are refreshed upon data updates, filtering, and highlighting. However, the image itself isn't interactive and can't be the source of cross-filtering.

        • Highlights: R visuals respond if you highlight other visuals, but you can't select elements in the R visual to cross filter other elements.

        • Display devices: Only plots that are plotted to the R default display device are displayed correctly on the canvas. Avoid explicitly using a different R display device.

        • RRO installations: In this release, the 32-bit version of Power BI Desktop doesn't automatically identify RRO installations; you must manually provide the path to the R installation directory in Options and settings > Options > R Scripting.

        Regards,

        Xiaoxin Sheng