The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I am running Python from Anaconda but the visual does not seem to be working:
This is what I get after running the code:
This is the error that I get:
Feedback Type:
Frown (Error)
Timestamp:
2022-01-06T19:41:51.1237834Z
Local Time:
2022-01-06T19:41:51.1237834+00:00
Session ID:
99893eb0-8e5a-4693-951a-bec6c351b93b
Release:
November 2021
Product Version:
2.99.862.0 (21.11) (x64)
Error Message:
Python script error.
C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
from . import multiarray
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XXXXXXX\PythonScriptWrapper_fa8a1b0d-0cad-45c8-8398-9706d90adc65\PythonScriptWrapper.PY", line 2, in <module>
import os, uuid, matplotlib
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\cbook\__init__.py", line 28, in <module>
import numpy as np
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py", line 145, in <module>
from . import core
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\USERS\XXXXXXX\ANACONDA3\python.exe"
* The NumPy version is: "1.20.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: Python script error.
C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
from . import multiarray
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XXXXXXX\PythonScriptWrapper_fa8a1b0d-0cad-45c8-8398-9706d90adc65\PythonScriptWrapper.PY", line 2, in <module>
import os, uuid, matplotlib
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\cbook\__init__.py", line 28, in <module>
import numpy as np
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py", line 145, in <module>
from . import core
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\USERS\XXXXXXX\ANACONDA3\python.exe"
* The NumPy version is: "1.20.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
---> Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException: Python script error.
C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
from . import multiarray
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XXXXXXX\PythonScriptWrapper_fa8a1b0d-0cad-45c8-8398-9706d90adc65\PythonScriptWrapper.PY", line 2, in <module>
import os, uuid, matplotlib
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\matplotlib\cbook\__init__.py", line 28, in <module>
import numpy as np
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\__init__.py", line 145, in <module>
from . import core
File "C:\USERS\XXXXXXX\ANACONDA3\lib\site-packages\numpy\core\__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\USERS\XXXXXXX\ANACONDA3\python.exe"
* The NumPy version is: "1.20.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
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.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
at Microsoft.PowerBI.ExploreHost.SemanticQuery.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__DisplayClass5_0.<ShowErrorDialogCore>b__0()
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.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.AllowModalDialogs(Action action)
at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass14_0.<ExecuteOnUIThreadAndHandlePromise>b__0()
at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass6_0`1.<ExecuteOnUIThread>b__0()
at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass5_0.<ExecuteOnUIThread>b__0(Object t)
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.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_1.<Main>b__2()
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.19042.0 (x64 en-US)
CLR Version:
4.7 or later [Release Number = 528372]
Peak Virtual Memory:
102 GB
Private Memory:
552 MB
Peak Working Set:
859 MB
IE Version:
11.789.19041.0
User ID:
55285dd7-b2ce-467d-86db-2d20bbb59db3
Workbook Package Info:
1* - en-US, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.
Telemetry Enabled:
True
Snapshot Trace Logs:
C:\Users\XXXXXXX\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShotd860e2e1-267d-4889-80ac-778cbb3d852a.zip
Model Default Mode:
Import
Model Version:
PowerBI_V3
Performance Trace Logs:
C:\Users\XXXXXXX\AppData\Local\Microsoft\Power BI Desktop\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_enableWebView2
PQ_WebView2Connector
PBI_useModernFormatPane
PBI_scorecardVisual
Disabled DirectQuery Options:
TreatHanaAsRelationalSource
Cloud:
GlobalCloud
DPI Scale:
150%
Supported Services:
Power BI
Formulas:
section Section1;
shared #"Table (2)" = let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJVitWJVnICsgwNwExnIFPXBMx0ATKNwSxXkKCZUmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Type = _t, Amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Type", type text}, {"Amount", Int64.Type}})
in
#"Changed Type";
Any help would be appreciated.
Solved! Go to Solution.
Hi @HamidBee ,
I'm not sure if this error is caused by some special settings of your computer or something else... I just follow the steps in the following official documentation to create phython visual with your provided table, it works well. Please check the screenshot below.
Create Power BI visuals by using Python
1. Install Phython
2. Install required Python packages
3. Enable Python scripting
4. Create Phython visual
You can first refer to the solution about the CMD command prompt not working in the links below to see if they can solve the CMD prompt problem. After that, then see if Phython visual works properly.
Can't open command prompt (cmd) on windows 10
How to Fix Command Prompt(CMD) Not Working/Opening in Windows 10
Best Regards
Hi,
I decided to not run Python on Anaconda so I can't really say it has or hasn't been resolved. Perhaps to avoid confusion you can go ahead and close this thread.
Thank you
Hi @HamidBee ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.
Best Regards
Hi,
I decided to not run Python on Anaconda so I can't really say it has or hasn't been resolved. Perhaps to avoid confusion you can go ahead and close this thread.
Thank you
What happened when you followed the advice from the error message:
"Please install mkl-service package"
Is this something that requires command prompt to install? If so is there an alternative way to install it without using command prompt as my work laptop has proxies set up which is proving to be dificult installing packages via command prompt.
Thank you
yes, you need to install that in the Python environment that you specified in the Power BI settings. How did you manage to install Python?
I understand. The issue for me right now is it's a work computer and it's got all sorts of things preventing me from installing it via the traditional method. Thanks for the help anyhow.
Hi @HamidBee ,
I'm not sure if this error is caused by some special settings of your computer or something else... I just follow the steps in the following official documentation to create phython visual with your provided table, it works well. Please check the screenshot below.
Create Power BI visuals by using Python
1. Install Phython
2. Install required Python packages
3. Enable Python scripting
4. Create Phython visual
You can first refer to the solution about the CMD command prompt not working in the links below to see if they can solve the CMD prompt problem. After that, then see if Phython visual works properly.
Can't open command prompt (cmd) on windows 10
How to Fix Command Prompt(CMD) Not Working/Opening in Windows 10
Best Regards
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
64 | |
46 | |
41 |