cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cheriemilk
Helper II
Helper II

[need help] why published python visual opened with 'script runtime error'?????

hi team,

1. i have upload a csv file in Desktop with source, target and value format. below is sample data.

    The size of my csv file only has 9KB with 100 rows.

dateData CenterCustomercompanyIDsourcetargetvalue
12/10/2020DCAcustomerAcompanyIDAview_goal_list_1 2
12/10/2020DCAcustomerAcompanyIDAview_goal_list_1click_edit_goal_23
12/10/2020DCAcustomerAcompanyIDAview_goal_list_1view_goal_card_22
12/11/2020DCAcustomerAcompanyIDAview_goal_list_1 43
12/11/2020DCAcustomerAcompanyIDAview_goal_list_1click_create_goal_21
12/11/2020DCAcustomerAcompanyIDAeview_goal_list_1click_edit_goal_21
......      

 

2. Then I run below code to plot the sankey chart into powerBI canvas in desktop.

 

import pandas as pd
import chart_studio.plotly as py
import plotly.graph_objects as go
labelListTemp1 = list(set(dataset.source.values))
labelListTemp2 = list(set(dataset.target.values))
labelList = labelListTemp1 + labelListTemp2
sankey_node = list(dict.fromkeys(labelList))
fig = go.Figure(data=[go.Sankey( node = dict( pad=15, 
                                             thickness=20, 
                                             line = dict(color = "black", width = 0.5),
                                             label = labelList,
                                             color = "blue" ),
                                              link = dict(source = dataset.source.apply(lambda x: labelList.index(x)),
                                                          target = dataset.target.apply(lambda x: labelList.index(x)),
                                                          value = dataset.value))])

fig.write_image('perfUXRGoal.png')

 

 

 

 

 

 

cheriemilk_0-1643250965982.png

 

 

3. Then I publish the sankey chart by click 'publish' button, and it says that 'publish successful'.

cheriemilk_1-1643250965989.png

 

 

4. Then I open it in poweBI, but the chart failed to open and says 'script run time error' and it says that no module 'chart-studio', 'plotly' was found. But I did install them, and the scripts can be run succesfully with image file created in my local native python environment

 

cheriemilk_2-1643250965958.png

 

 

Help needed: what's the issue here and how can the published report be opened successfully??  I spent lot of time on this issue and  can't figure out myself.

 

The size of my csv file only has 9KB with 100 rows.

 

1 ACCEPTED SOLUTION

Hi, @cheriemilk 

 

'Manage gateways' is for standard mode. If you use personal mode for python, you can directly go to dataset>>setting>>gateway. Then you can find the personal gateway.

vjaneygmsft_0-1643771097752.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

 

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

Have you installed the personal gateway that is required in such a scenario?

Have you considered using the native Sankey visual instead?

@lbendlin  

1. I tried native sankey visual, but native Sankey visual can't generate a proper chart as i have lots of nodes. that's why i need plot the sankey chart by python plotly myself.

2. why need gateway when creating customize python visual?  how to install and configure gateway? and need powerBI do some additional configration as well?

Thanks,

Cherie

@lbendlin , thanks for sharing. 

I viewed the link you shared. 

First, I downloaded the powerBI gateway and install it with selecting 'personal mode'. and then it says that 'The gateway is online and ready to be used'. 

 But when I open the published report from link 'https://app.powerbi.com...',  the report stlll not opened succesfully amd 'script Runtime error' pops up again.

 

According to this guide Use personal gateways in Power BI - Power BI | Microsoft Docs, looks like i have finished all the steps.  

 

Then I opened this guide Add or remove a gateway data source - Power BI | Microsoft Docs, but when clicking 'Manage Gateways', it says that 'You don't have any data gateways'

cheriemilk_0-1643351345549.png

 

cheriemilk_1-1643351706247.png

 

Any idea?

 

Thanks,

Cherie

 

Hi, @cheriemilk 

 

'Manage gateways' is for standard mode. If you use personal mode for python, you can directly go to dataset>>setting>>gateway. Then you can find the personal gateway.

vjaneygmsft_0-1643771097752.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors