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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Can't display python visual

Dear Community,

I cannot seem to use python visuals (anymore), however it works for most of my colleagues in our organisation.

Any python visual (even the most simple example scatter plot with simple sample data, see https://docs.microsoft.com/en-us/power-bi/desktop-python-visuals ) does not work, and I get this error instead:

PowerBI_PythonVisual_error.jpg

 

 

 

 

 

 

 

 

 

 

 

 

I have python 3.6.5 installed.

 

Any ideas?

 

Thanks!

 

Details of the error message:

 

 

Feedback Type:
Frown (Error)
Timestamp:
2019-10-29T10:07:39.2968466Z
Local Time:
2019-10-29T10:07:39.2968466+00:00
Session ID:
9557d664-d1da-48a5-ad25-298e96d1679d
Release:
October 2019
Product Version:
2.74.5619.862 (19.10) (x64)
Error Message:
An exception of type Microsoft.PowerBI.ExploreServiceCommon.ContainPIIException occured.
Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ContainPIIException: ScriptVisualCommandFlow-GenerateVisualError ---> Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: The Python process ended unexpectedly, so the visual can't be displayed. Please try running it again. ---> System.ComponentModel.Win32Exception: The file or directory is corrupted and unreadable
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at Microsoft.PowerBI.Scripting.Python.PythonScriptWrapper.GetPythonVersionAndEmitTrace(String pythonExePath, Int32 scriptHash)
   at Microsoft.PowerBI.Scripting.Python.PythonScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)
   at Microsoft.PowerBI.Client.Windows.Python.PythonScriptHandler.GenerateVisual(ScriptHandlerOptions options)
   --- End of inner exception stack trace ---
   at Microsoft.PowerBI.Client.Windows.Python.PythonScriptHandler.GenerateVisual(ScriptHandlerOptions options)
   at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   --- End of inner exception stack trace ---
   at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreServiceCommon.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode& serviceErrorStatusCode, CancellationToken cancelToken)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)
Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
   at Microsoft.PowerBI.Client.Windows.ErrorHostService.GetErrorDetails(ShowErrorDialogArgs args)
   at Microsoft.PowerBI.Client.Windows.ErrorHostService.<>c__DisplayClass2_0.<<ShowErrorDialog>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.PowerBI.Client.Windows.ErrorHostService.<>c__DisplayClass2_0.<ShowErrorDialog>b__0()
   at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass1_0`1.<SendAndMarshalExceptions>b__0()
   at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass0_1.<SendAndMarshalExceptions>b__0(Object null)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__0(IWindowHandle owner)
   at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
   at Microsoft.PowerBI.Client.Program.<>c__DisplayClass2_0.<Main>b__1()
   at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)

OS Version:
Microsoft Windows NT 10.0.18362.0 (x64 en-GB)
CLR Version:
4.7 or later [Release Number = 528040]
Peak Virtual Memory:
42.4 GB
Private Memory:
2.14 GB
Peak Working Set:
4.49 GB
IE Version:
11.418.18362.0
User ID:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Workbook Package Info:
1* - en-GB, Query Groups: 10, fastCombine: Disabled, runBackgroundAnalysis: True.
Telemetry Enabled:
False
Model Default Mode:
Composite

 

 

 

 

 

 

 

Status: New
Comments
Anonymous
Not applicable

I'm having the exact same problem, except I'm not sure if I could ever launch a visualisation. I'm just getting my head around Power BI for the first time now. I can't find anything on the exception Microsoft.PowerBI.ExploreServiceCommon.ContainPIIException, either. Any help would be greatly appreciated.

shadho
Regular Visitor

I have been getting the  same exception Microsoft.PowerBI.ExploreServiceCommon.ContainPIIException, with R visual. I'm trying to create a word cloud in R  and render it on the power bi desktop. Th R code runs fine on my machine   but the Power Bi R script does not seem to work at all.

 

Was also wondering if ,  the visual will render on the dashboard once i publish it for R , as that didn't work for Python.

Sudheerv
Regular Visitor

I'm having the Same issue. 
Same here, this needs to get fixed asap as most of the custom visuals stopped working...

Anonymous
Not applicable

Same issue using R

christianjohan
Frequent Visitor

Same error for me using R, plot_ly.

Anonymous
Not applicable

Same error for me using R.  Using Version: 2.75.5649.961 64-bit (November 2019)

Anonymous
Not applicable

Same error for me using R 3.6.1 Using Version: 2.75.5649.961 64-bit (November 2019)

Kalaiselvan
New Member

I am also getting the same error. 

 

using python version 3.7.4

Anonymous
Not applicable

me to with Python. The matplotlib plots fine on the same dataset on jupyter or local system but fails with this non-informative error in Power Bi.

augustindelaf
Impactful Individual

same error