Forum Discussion

Steve331's avatar
Steve331
New Member
3 years ago
Solved

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

  • 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 🙂

4 Replies

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

    • Steve331's avatar
      Steve331
      New Member

      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>"
       
       

       

      • lbendlin's avatar
        lbendlin
        Super User

        change

        Data.reset_index(inplace=True)

        to 

        data.reset_index(inplace=True)