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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hedgehogabraxas
New Member

Python Plot opens in a new tab instead of PowerBI

After paste and run my python code I see that my plot is not displayed on PowerBI, instead is open in in a new chrome tab, these are the details of the message that I got after run it:

Feedback Type:
Frown (Error)

Timestamp:
2021-11-16T21:08:24.6212406Z

Local Time:
2021-11-16T15:08:24.6212406-06:00

Session ID:
95db20a0-db01-41e2-b1d3-a111d025bc7c

Release:
November 2021

Product Version:
2.99.621.0 (21.11) (x64)

Error Message:
No se ha creado ninguna imagen. El código de Python no ha generado la creación de objetos visuales. Asegúrese de que el script de Python tenga como resultado un trazado en el dispositivo predeterminado de Python.

Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: No se ha creado ninguna imagen. El código de Python no ha generado la creación de objetos visuales. Asegúrese de que el script de Python tenga como resultado un trazado en el dispositivo predeterminado de Python.
en Microsoft.PowerBI.Client.Windows.Python.PythonScriptHandler.GenerateVisual(ScriptHandlerOptions options)
en Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
en Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
en Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
en Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode& serviceErrorStatusCode, CancellationToken cancelToken)
en Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)

Invocation Stack Trace:
en Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
en Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
en Microsoft.PowerBI.Client.Windows.ErrorHostService.GetErrorDetails(ShowErrorDialogArgs args)
en Microsoft.PowerBI.Client.Windows.ErrorHostService.<>c__DisplayClass5_0.<ShowErrorDialogCore>b__0()
en System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
en System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
en System.Delegate.DynamicInvokeImpl(Object[] args)
en System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
en System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
en System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
en System.Windows.Forms.Control.InvokeMarshaledCallbacks()
en System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
en System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
en System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)
en Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.AllowModalDialogs(Action action)
en Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass14_0.<ExecuteOnUIThreadAndHandlePromise>b__0()
en Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass6_0`1.<ExecuteOnUIThread>b__0()
en Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass5_0.<ExecuteOnUIThread>b__0(Object t)
en System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
en System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
en System.Delegate.DynamicInvokeImpl(Object[] args)
en System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
en System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
en System.Windows.Forms.Control.InvokeMarshaledCallbacks()
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
en Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
en Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_1.<Main>b__2()
en Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
en Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
en Microsoft.PowerBI.Client.Program.Main(String[] args)


OS Version:
Microsoft Windows NT 10.0.22000.0 (x64 es-ES)

CLR Version:
4.7 or later [Release Number = 528449]

Peak Virtual Memory:
103 GB

Private Memory:
852 MB

Peak Working Set:
1.19 GB

IE Version:
11.1.22000.0

User ID:
7c6c4084-4144-4a59-bbf4-31b71a8fdb1f

Workbook Package Info:
1* - es-MX, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.

Telemetry Enabled:
True

Snapshot Trace Logs:
C:\Users\antonio\Microsoft\Power BI Desktop Store App\FrownSnapShot4c2de09e-0798-421b-b109-d261e1efe727.zip

Model Default Mode:
Import

Model Version:
PowerBI_V3

Performance Trace Logs:
C:\Users\antonio\Microsoft\Power BI Desktop Store App\PerformanceTraces.zip

Enabled Preview Features:
PBI_rdlNativeVisual

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_azureMapVisual
PBI_dataPointLassoSelect
PBI_compositeModelsOverAS
PBI_dynamicParameters
PBI_enhancedTooltips
PBI_useModernFormatPane
PBI_scorecardVisual

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
125%

Supported Services:
Power BI

Formulas:


section Section1;

shared output_labeled_sequences = let
Origen = Csv.Document(File.Contents("Z:\arkon\algoritmos\PrefixSpan\Data\output_labeled_sequences.csv"),[Delimiter=",", Columns=11, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}}),
#"Encabezados promovidos" = Table.PromoteHeaders(#"Tipo cambiado", [PromoteAllScalars=true]),
#"Tipo cambiado1" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Work_id", type text}, {"bin_1", type text}, {"bin_2", type text}, {"bin_3", type text}, {"bin_4", type text}, {"bin_5", type text}, {"bin_6", type text}, {"bin_7", type text}, {"bin_8", type text}, {"bin_9", type text}, {"bin_10", type text}})
in
#"Tipo cambiado1";

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @hedgehogabraxas ,

 

Could you please share sample data(non-sensitive data) of your table and detailed Python script so that I can test?

In addition, I searched some similar threads, which may help you:

https://community.powerbi.com/t5/Issues/Bug-in-python-visual/idi-p/487259#comments 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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