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

Can't get python working?

Trying to get Python visual scripting up and working. I have recently installed Anaconda in my user drive. I can run the following code in Spyder without issue, however when I try to do it in Power BI python visual I get the following error. I navigated to the python.exe in ProgramData > Anaconda3 in the Power BI settings. There is also a python.exe in packages folder but when I use this one I get a separate error saying it can't import matplotlib.

 

So basically I've never had python functioning in Power BI. November 2018 Power BI, hoping an upgrade to March 2019 will help, but any upgrade/rebuild is difficult with current IT policy. Even 'updating' numpy using conda is out, but the fact it runs fine in spyder leads me to believe the below message is a red herring, and it just isn't finding the correct packages?

 

Appreciate any help, pretty excited about this potential.

 

# code
from matplotlib import pyplot as plt 
plt.plot([1,2],[3,4])

 

-----------------------------------------------

Feedback Type:
Frown (Error)

Timestamp:
2019-04-01T22:26:28.9989781Z

Local Time:
2019-04-02T09:26:28.9989781+11:00

Session ID:
2ca4b2d2-ebbb-4918-80de-0eefdef53ba4

Release:
November 2018

Product Version:
2.64.5285.741 (18.11) (x64)

Error Message:
Python script error.
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, matplotlib.pyplot, uuid, pandas
File "C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 141, in <module>
from . import cbook, rcsetup
File "C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 33, in <module>
import numpy as np
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

 

OS Version:
Microsoft Windows NT 10.0.17134.0 (x64 en-GB)

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

Peak Virtual Memory:
38.3 GB

Private Memory:
465 MB

Peak Working Set:
1.07 GB

IE Version:
11.590.17134.0

User ID:
2b1d5f11-775b-4370-9556-d65aac5aba87

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

Telemetry Enabled:
True

Model Default Mode:
Import

Snapshot Trace Logs:
C:\Users\dlance\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot1395309066.zip

Performance Trace Logs:
C:\Users\dlance\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

Enabled Preview Features:
PBI_PdfImport
PBI_PythonSupportEnabled

Disabled Preview Features:
PBI_shapeMapVisualEnabled
MIntellisense
PBI_SpanishLinguisticsEnabled
PBI_ColumnProfiling
PBI_variationUIChange
PBI_showIncrementalRefreshPolicy
PBI_showManageAggregations
PBI_FuzzyMatching
PBI_EnableWebDiagramView
PBI_improvedFilterExperience

Disabled DirectQuery Options:
PBI_DirectQuery_Unrestricted
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
100%

Supported Services:
Power BI

Formulas:


section Section1;

shared #"Example Data" = let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jZVrasQwDISvUpb+zBZL8ktnKb3/NRrZXktriVIopSUfyowek+/vByboz8T3z+N6QL1/fXz28pXSx/gTLqpp/PdzKQzpfpgni5sl7J6E+xHSRHmjeKXcPIyiASe8Wa4elIJ9PFWpOdApGjFNJ9UIDdByP5o6CfTd5MG6302khmr2ZFPv2DZaETwqBWfzISkZyOQNFmOIfI+GbTgbv/58AwWC6aixmXxG9DCqp9wMnLp3NbjF6poABmKzKatd5UiuDApWV80AOEClUTh7UNCK5cCZTKtNwCgIXEmrhoq7X7ZqT35eyLsF5qiK40gvCnT12yET0jOZg3p7ey3Vw+Og1hJkNYXZozqrrvuPmTwpMvm8KchBzTGqifb2pjUoW7UDetMea//NKYFlVFCOQIHz/IXkPX3W6dcCjhzZt2qqffYlR98hneePLUBRM0U9YQ9I+tf9C5n1rNnM6WpnTAssfvA8vx5UrRrRulA5qNh2/BhLVDzYNaMLGJ0pGNNYJlxbkv/0P0rOiZJGKoIvimZQbK7k/KAIivtKqhaFYFDjRFf2VHunlPxRD0evpTaLeuXkO2sDsJhV9WBVX+b8erCAI/xWTfMJgObJvs+UjNISmOKdE38m2oi+JdMkWgvGT9LPckY/nHkKsGISH8dnup3fHkFR328skRsqzJBc248q1X38BR0jzUdM9AAsRqnOs7kpwYzISbKJUw6Kth0o+vLXlf78Ag==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Units = _t, Price = _t, Revenue = _t])
in
Source;

3 REPLIES 3
TimoRiikonen
Advocate III
Advocate III

I solved my Numpy DLL load failure issues by replacing Anaconda3 with WinPython. WinPython worked with Power BI.

 

v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

Check if the following link helps.

https://community.powerbi.com/t5/Issues/python-script-error/idi-p/543663

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Unfortunatley not @v-chuncz-msft 

 

Apologies if I'm missing it as well, but I can't actually see anything in the post that would help. I tried cutting and pasting the post scirpt directly and it didn't work, I get the same error. Python is having issues getting multiarray form numpy, basic stuff.

 

I'm convinced its not the python script, it works outside Power BI and I made is as absolutely simple as possible?

 

I believe it is an issue with how Power BI connects to python in my setup, perhaps an authorisation, but we have no way to trouble shoot or remedy. The only other thing I can think is it is being directed to the wrong numpy version or there is something Power vi doesn't like about the numpy version.

 

I note there is 2 locations in anaconda:

- C:\ProgramData\Anaconda3\pkgs\numpy-base-1.15.4-py37hc3f5095_0\Lib\site-packages\numpy

 

 

Appreciate any more ideas?

 

Thanks

Dane

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.