cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
TiborTuboly
Frequent Visitor

Python script error - ImportError: DLL load failed: The specified module could not be found.

Hi,

 

I would like to run the following python script:

import pandas as pd

data=pd.read_table('https://raw.githubusercontent.com/petroGG/Basic-Well-Log-Interpretation/master/WA1.txt', delim_whitespace=True, index_col='M__DEPTH')

data=data.rename(columns=({'M__DEPTH':'DEPT'}))
data['DEPT']=data.index

 

But after I copy+paste it to Get Data->Python script, it gives the following error.

 

Details: "ADO.NET: Python script error.
Traceback (most recent call last):
  File "PythonScriptWrapper.PY", line 2, in <module>
    import os, pandas, matplotlib.pyplot
  File "C:\Users\tutsrr\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\pyplot.py", line 32, in <module>
    import matplotlib.colorbar
  File "C:\Users\tutsrr\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
    import matplotlib.contour as contour
  File "C:\Users\tutsrr\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\contour.py", line 18, in <module>
    import matplotlib.font_manager as font_manager
  File "C:\Users\tutsrr\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\font_manager.py", line 48, in <module>
    from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: The specified module could not be found.

 

Do you have any idea how to solve it? Python home directory is correctly set up in Power BI and my DLL files seems okay in my system folder.

Thanks.
Tibor

4 REPLIES 4
v-xicai
Community Support
Community Support

  

Hi @TiborTuboly ,

 

which version of Python your Anaconda environment is using? Try to create a new conda env with Python 3.5:

 

conda create -n py35 anaconda python=3.5

 

Then pip installing relevant packages:

 

conda activate py35

py -m pip install matplotlib

py -m pip install pandas

 

After finishing it, you need to point Power BI Desktop to the new env following steps :File -> Options and Settings -> Options -> Python Scripting. Then add the Path to your new Env, looks like: "C:\ProgramData\Anaconda3\envs\py35".

 

You can go through the links to learn more:   https://github.com/stan-dev/pystan/issues/520

https://stackoverflow.com/questions/53929599/cannot-import-aer-from-qiskit-0-7/54275759#54275759

https://github.com/Qiskit/qiskit-aer/issues/25

https://github.com/ContinuumIO/anaconda-issues/issues/10628

https://github.com/pytorch/pytorch/issues/9263

 

If you still have this issue for Power BI, you'd better create a support ticket in Power BI Support to get further help.

 

Best Regards,

Amy

 

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

 

 

This perfectly worked out for me. Thanks

I just want to say thank you for posting this, I have been trying to get this to work for like 3 days and this is the one thing that finally fixed it for me. 

Hi Amy,

unfortunately, I cannot create a new environment, my company laptop does not allow it.

I will try to install Python in my on my personal computer and I will try to run this code again.

I hope it solves the issue. I will get back with the results. 

Thank you.
Tibor

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors