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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Jeanxyz
Impactful Individual
Impactful Individual

data refreshing issue related to python script

I'm trying to import data from AWS S3 bucket into power bi using python script. the script works in Power BI desktop, but I encounter data refresh failures after publishing it to PB service. 

error message:

"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"ADO.NET: Python script error.\r\nModuleNotFoundError: No module named 'boto3'\r\n</pi>"}}

my python script set up in PB Options and Settings

python environment.PNG

Based on Python setup in Power BI, I have manually saved the boto3 package in C:\Python311\Lib\site-packages, below is the python script I used to import AWS bucket3 data. 

*****************

import pandas as pd
import io
import os
import boto3

....

***************

But the error message seems to suggest it couldn't import boto3. Where should the boto3 package to stored?

 

@lucazav 

 

 

1 ACCEPTED SOLUTION
Jeanxyz
Impactful Individual
Impactful Individual

Raised a support ticket to Microsoft and heard back that boto3 package is not supported in Power BI. Below is MS response: 

I checked your issue with my internal team and got to know that as the boto 3 python package is not listed in the support packages for power BI as per this document (Learn which Python packages are supported - Power BI | Microsoft Learn). For python scripts used in power BI you can install and use the boto 3 in power BI desktop.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Jeanxyz ,

 You can do this by running the following command in your terminal or command prompt:

pip install boto3

This command will help you to install boto3 directly before trying to import boto3

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jeanxyz
Impactful Individual
Impactful Individual

I have done that already. The installation is successful, but data refreshing still showing the same error. 

boto3 install.PNG

Anonymous
Not applicable

Hi @Jeanxyz ,

If you still report the same error, you can try reading this article:

How To Solve ModuleNotFoundError: No module named in Python (pytutorial.com)

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jeanxyz
Impactful Individual
Impactful Individual

Raised a support ticket to Microsoft and heard back that boto3 package is not supported in Power BI. Below is MS response: 

I checked your issue with my internal team and got to know that as the boto 3 python package is not listed in the support packages for power BI as per this document (Learn which Python packages are supported - Power BI | Microsoft Learn). For python scripts used in power BI you can install and use the boto 3 in power BI desktop.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (4,075)