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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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.

 

 

Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors