Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
ImkeF
Community Champion
Community Champion

Error in running an R script in Power Query

Hi there,

I'm running into a problem with most of my R-scripts, as they simply don't run in Power BI although they run in RStudio.

Simple sample:

library("Quantmod")
getOptionChain("AAPL")

Error-message:

Details: "ADO.NET: R script error.
Loading required package: xts
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: TTR
Error: package or namespace load failed for 'TTR':
 package 'curl' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error: package 'TTR' could not be loaded
Execution halted

The error-messages vary slightly from script to script, but are very similar, as they always complain about different internals problems with loading libraries that load fine in RStudio.

 

Shouldn't this simply work?

 

I've tried several R-versions between 3.4 and 3.6

 

Thanks.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

1 ACCEPTED SOLUTION

Hi @v-yulgu-msft ,

this is a bug that others have as well: https://community.powerbi.com/t5/Issues/R-visual-error-quot-package-was-installed-by-an-R-version-wi...

 

Forgot to close this thread, sorry.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @ImkeF ,

 

Please make sure you have installed required packages successfully, referring to this article.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft ,

this is a bug that others have as well: https://community.powerbi.com/t5/Issues/R-visual-error-quot-package-was-installed-by-an-R-version-wi...

 

Forgot to close this thread, sorry.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.