cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

2 REPLIES 2
Highlighted
Community Support
Community Support

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

  

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.

 

 

Highlighted
Frequent Visitor

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors