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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.