<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: No Module Found Name MatPlotLib in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541602#M45408</link>
    <description>&lt;P&gt;Here's the official doc&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts" target="_blank"&gt;Run Python scripts in Power BI Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 05:47:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-20T05:47:28Z</dc:date>
    <item>
      <title>No Module Found Name MatPlotLib</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541594#M45407</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do a simple plot with matplotlib in a python script visual within powerbi. I have already tried installing matplotlib globally, in the directory where the pbi file is, and in the python home directory used by PowerBI. No matter how simple I make the script, I cannot use matplotlib package in any situation. Tried installing and restarting the computer and the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any potential solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. Here is a copy of the error message:&lt;/P&gt;&lt;P&gt;Feedback Type:&lt;BR /&gt;Frown (Error)&lt;/P&gt;&lt;P&gt;Error Message:&lt;BR /&gt;Python script error.&lt;BR /&gt;&amp;lt;pi&amp;gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\YonatanPalagashvili\PythonScriptWrapper_caa22846-a210-4728-95a3-0df80a527033\PythonScriptWrapper.PY", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;import os, uuid, matplotlib&lt;BR /&gt;ModuleNotFoundError: No module named 'matplotlib'&lt;BR /&gt;&amp;lt;/pi&amp;gt;&lt;/P&gt;&lt;P&gt;Stack Trace:&lt;BR /&gt;Host:Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\YonatanPalagashvili\PythonScriptWrapper_caa22846-a210-4728-95a3-0df80a527033\PythonScriptWrapper.PY", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;import os, uuid, matplotlib&lt;BR /&gt;ModuleNotFoundError: No module named 'matplotlib'&lt;/P&gt;&lt;P&gt;at Microsoft.PowerBI.Scripting.Python.PythonScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Python.PythonScriptHandler.GenerateVisual(ScriptHandlerOptions options)&lt;BR /&gt;--- End of inner exception stack trace ---&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Python.PythonScriptHandler.GenerateVisual(ScriptHandlerOptions options)&lt;BR /&gt;at Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor&amp;amp; bindingDescriptor)&lt;BR /&gt;at Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor&amp;amp; bindingDescriptor)&lt;BR /&gt;at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor&amp;amp; bindingDescriptor)&lt;BR /&gt;at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode&amp;amp; serviceErrorStatusCode, CancellationToken cancelToken)&lt;BR /&gt;at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)&lt;/P&gt;&lt;P&gt;Javascript&amp;amp;colon;ShowErrorDialog&lt;BR /&gt;at ErrorHostService.showErrorDialogCore(args)&lt;/P&gt;&lt;P&gt;Stack Trace Message:&lt;BR /&gt;Python script error.&lt;/P&gt;&lt;P&gt;Invocation Stack Trace:&lt;BR /&gt;at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()&lt;BR /&gt;at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)&lt;BR /&gt;at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.&amp;lt;&amp;gt;c__DisplayClass14_0.&amp;lt;HandleException&amp;gt;b__0()&lt;BR /&gt;at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)&lt;BR /&gt;at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Utilities.PowerBIFormUnexpectedExceptionHandler.HandleException(Exception e)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.ErrorHostService.&amp;lt;&amp;gt;c__DisplayClass6_0.&amp;lt;ShowErrorDialogCore&amp;gt;b__0()&lt;BR /&gt;at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)&lt;BR /&gt;at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)&lt;BR /&gt;at System.Delegate.DynamicInvokeImpl(Object[] args)&lt;BR /&gt;at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)&lt;BR /&gt;at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)&lt;BR /&gt;at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)&lt;BR /&gt;at System.Windows.Forms.Control.InvokeMarshaledCallbacks()&lt;BR /&gt;at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)&lt;BR /&gt;at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)&lt;BR /&gt;at System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.AllowModalDialogs(Action action)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.&amp;lt;&amp;gt;c__DisplayClass14_0.&amp;lt;ExecuteOnUIThreadAndHandlePromise&amp;gt;b__0()&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.ExecuteOnUIThreadAndHandlePromise[T](Func`1 func, IPromiseStore promiseStore, Int64 promiseHandle)&lt;BR /&gt;at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)&lt;BR /&gt;at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)&lt;BR /&gt;at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.WebView2.WebView2Interop.InvokeCs(InteropCall call)&lt;BR /&gt;at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)&lt;BR /&gt;at System.EventHandler`1.Invoke(Object sender, TEventArgs e)&lt;BR /&gt;at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)&lt;BR /&gt;at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)&lt;BR /&gt;at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)&lt;BR /&gt;at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)&lt;BR /&gt;at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)&lt;BR /&gt;at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)&lt;BR /&gt;at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)&lt;BR /&gt;at Microsoft.PowerBI.Client.Program.&amp;lt;&amp;gt;c__DisplayClass6_0.&amp;lt;RunApplication&amp;gt;b__0()&lt;BR /&gt;at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.&amp;lt;&amp;gt;c__DisplayClass3_0.&amp;lt;HandleExceptionsWithNestedTasks&amp;gt;b__0()&lt;BR /&gt;at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)&lt;BR /&gt;at Microsoft.PowerBI.Client.Program.RunApplication(String[] args)&lt;BR /&gt;at Microsoft.PowerBI.Client.Program.Main(String[] args)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PowerBINonFatalError:&lt;BR /&gt;{"AppName":"PBIDesktop","AppVersion":"2.122.1066.0","ModuleName":null,"Component":"Microsoft.PowerBI.Scripting.Python.PythonScriptWrapper","Error":"Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException","MethodDef":"RunScript","ErrorOffset":"","ErrorCode":""}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model Default Mode:&lt;BR /&gt;Import&lt;/P&gt;&lt;P&gt;Model Version:&lt;BR /&gt;PowerBI_V3&lt;/P&gt;&lt;P&gt;Enabled Preview Features:&lt;BR /&gt;PBI_sparklines&lt;BR /&gt;PBI_scorecardVisual&lt;BR /&gt;PBI_NlToDax&lt;BR /&gt;PBI_fieldParametersSuperSwitch&lt;BR /&gt;PBI_setLabelOnExportPdf&lt;BR /&gt;PBI_dynamicFormatString&lt;BR /&gt;PBI_oneDriveSave&lt;BR /&gt;PBI_oneDriveShare&lt;BR /&gt;PBI_newCard&lt;/P&gt;&lt;P&gt;Disabled Preview Features:&lt;BR /&gt;PBI_shapeMapVisualEnabled&lt;BR /&gt;PBI_SpanishLinguisticsEnabled&lt;BR /&gt;PBI_qnaLiveConnect&lt;BR /&gt;PBI_b2bExternalDatasetSharing&lt;BR /&gt;PBI_enhancedTooltips&lt;BR /&gt;PBI_angularRls&lt;BR /&gt;PBI_onObject&lt;BR /&gt;PBI_backstageUI&lt;BR /&gt;PBI_gitIntegration&lt;BR /&gt;PBI_modelExplorer&lt;/P&gt;&lt;P&gt;Disabled DirectQuery Options:&lt;BR /&gt;TreatHanaAsRelationalSource&lt;/P&gt;&lt;P&gt;Cloud:&lt;BR /&gt;GlobalCloud&lt;/P&gt;&lt;P&gt;PowerBIUserFeedbackServices_IsReported:&lt;BR /&gt;True&lt;/P&gt;&lt;P&gt;Formulas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 05:42:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541594#M45407</guid>
      <dc:creator>YoniPal</dc:creator>
      <dc:date>2023-11-20T05:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: No Module Found Name MatPlotLib</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541602#M45408</link>
      <description>&lt;P&gt;Here's the official doc&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts" target="_blank"&gt;Run Python scripts in Power BI Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 05:47:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541602#M45408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-20T05:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: No Module Found Name MatPlotLib</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541699#M45410</link>
      <description>&lt;P&gt;It seems like there might be an issue with the Python environment that Power BI is using. Let's try a few troubleshooting steps to resolve the problem:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Ensure Power BI is Using the Correct Python Environment:&lt;/STRONG&gt; Make sure that Power BI is using the correct Python environment where Matplotlib is installed. You can specify the Python script settings in Power BI. Follow these steps:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In Power BI Desktop, go to "File" &amp;gt; "Options and settings" &amp;gt; "Options."&lt;/LI&gt;&lt;LI&gt;In the "Options" dialog, go to "Python scripting."&lt;/LI&gt;&lt;LI&gt;Specify the path to the correct Python executable in the "Detected Python home directories" or "Python home directory" field.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Check Python Path:&lt;/STRONG&gt; Ensure that the Python path where Matplotlib is installed is included in the system's PATH environment variable. This can be set either globally or within the Power BI Python options.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Install Matplotlib Using Power BI's Python Environment:&lt;/STRONG&gt; Open Power BI and run the following Python script in the Python script editor to install Matplotlib:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;import subprocess&lt;BR /&gt;subprocess.check_call(["python", "-m", "pip", "install", "matplotlib"])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;This script uses the Python interpreter that Power BI is configured to use. After running this script, try your Matplotlib script again.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Restart Power BI:&lt;/STRONG&gt; After making changes to Python configurations or installing packages, it's a good idea to restart Power BI to ensure the changes take effect.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Use Virtual Environment (Optional):&lt;/STRONG&gt; Consider using a virtual environment for your Python script within Power BI. This can help isolate dependencies and avoid conflicts.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Check Python Version Compatibility:&lt;/STRONG&gt; Ensure that the version of Python installed matches the version supported by Matplotlib. You can check Matplotlib's documentation for compatibility information.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Review Security Policies:&lt;/STRONG&gt; Check if there are any security policies or antivirus programs that might be blocking Power BI from accessing Python libraries. Ensure that the required permissions are granted.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Reinstall Power BI:&lt;/STRONG&gt; As a last resort, if the issue persists, consider reinstalling Power BI to ensure a clean installation.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Read this blog for more about MatPlotLib:&lt;BR /&gt;&lt;A href="https://analyticpulse.blogspot.com/2023/11/enhancing-power-bi-visualizations-with.html" target="_blank"&gt;https://analyticpulse.blogspot.com/2023/11/enhancing-power-bi-visualizations-with.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helped, Subscribe AnalyticPulse on YouTube for future updates:&lt;BR /&gt;&lt;A href="https://www.youtube.com/@AnalyticPulse" target="_blank"&gt;https://www.youtube.com/@AnalyticPulse&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://instagram.com/analytic_pulse" target="_blank"&gt;https://instagram.com/analytic_pulse&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://analyticpulse.blogspot.com/" target="_blank"&gt;https://analyticpulse.blogspot.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 06:45:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3541699#M45410</guid>
      <dc:creator>AnalyticPulse</dc:creator>
      <dc:date>2023-11-20T06:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: No Module Found Name MatPlotLib</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3955428#M52915</link>
      <description>&lt;P&gt;Same error. How did you solve it?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 14:47:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/No-Module-Found-Name-MatPlotLib/m-p/3955428#M52915</guid>
      <dc:creator>shparberpartne</dc:creator>
      <dc:date>2024-05-28T14:47:06Z</dc:date>
    </item>
  </channel>
</rss>

