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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

[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. 

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

 

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')

 

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

 

 

 

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, @Anonymous 

 

'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?

Anonymous
Not applicable

@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

Anonymous
Not applicable

@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, @Anonymous 

 

'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 Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors