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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Steve331
New Member

Python Error

I'm new to using PowerBi and Python and have tried enrolling on a course that shows how to build up a stocks and shares dashboard. I've used the commenads suggested but Python is coming up with the following error 

Details: "ADO.NET: Python script error.
<pi>ModuleNotFoundError: No module named 'yfinance'
</pi>"

 

The full script I'm using is as follows :

 

import pandas as pd

import yfinance as yf

ticker="AAPL"

 

data= yf.download(ticker, start="2019-01-01", end="2022-12-31")

Data.reset_index(inplace=True)

data

 

Can anyone give me any suggestions as to how to fix this please?

Thanks Steve

2 ACCEPTED SOLUTIONS

change

Data.reset_index(inplace=True)

to 

data.reset_index(inplace=True)

View solution in original post

Ahh brilliant That worked-didn't notice I had that capital at start-Thanks so much for your help 🙂

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

before you can use that module in Power BI you need to add it to your PC's Python install, via pip, for example.

Thanks lbendlin

I fixed that issue but now I have the following error message : 
Details: "ADO.NET: Python script error.
<pi>NameError: name 'Data' is not defined. Did you mean: 'data'?
</pi>"
 
 

 

change

Data.reset_index(inplace=True)

to 

data.reset_index(inplace=True)

Ahh brilliant That worked-didn't notice I had that capital at start-Thanks so much for your help 🙂

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.