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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Python script error: 'No module named pandas'

I tried getting data with a python script and recieved the following error:

 

Details: "ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib.pyplot
ModuleNotFoundError: No module named 'pandas'
"

 

Here's the python code:

import datetime
import fix_yahoo_finance as yf


start = datetime.datetime(2016,1,1) #start with January 1st 2016
end = datetime.date.today()


fb = yf.download('fb', start, end) #fb call
fb['Name'] = "fb"

nflx = yf.download('nflx', start, end) #nflx call
nflx['Name'] = 'nflx'

aapl = yf.download('aapl', start, end) 
aapl['Name'] = "aapl"

stocks = fb.append([nflx, aapl])
stocks['date'] = stocks.index

 

The code runs perfeclty fine in PyCharm so it seems to be a PBI issue.

 

 

5 REPLIES 5
Anonymous
Not applicable

@Anonymous Please install all the packages that you are mentioning in the python script in Power BI, explicitly in Command Prompt.

 

Open Command Prompt >  for example, type in " py -m pip install pandas" without quotes and then try running the py script in Power BI.

It worked for me.

 

Cheers. 

This work for me in PBI Desktop

Anonymous
Not applicable

have the same problem. How do I open CMD in Power BI online to install modules?

My dash works on Desktop, but when I go online it says it didn't find the modules.

Hello!

We are facing same here!

 

Have you figured out how to solve?

v-lili6-msft
Community Support
Community Support

hi, @Anonymous

I'm not a Python script experts I did a lot of searching for this error, there is no result about Power bi,

It seems to be a Python issue. You may try some solutions about it.

If you still have this issue for Power BI, you'd better create a support ticket in Power BI Support to get further help.

 

Best Regards,

Lin

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

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.