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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ashwini_bora
Regular Visitor

Importing data in Snowflake using Python script

Hi- I am trying to import the data from Snowflake DB using the python script in Power BI and want to create reports using Python provided packages.

 

The complete script works well on Python IDE (Spyder), however getting error while importing as below-

Get Data --> Python Script

 

import snowflake.connector

<code to connect to Snowflake and fetch data>

 

Getting error on first line, while trying to import the snowflake connector, error:

Details: ADO.NET: Python script error. <pi>ImportError: DLL load failed: The specified module could not be found. </pi>

 

Python installation is fine and with other local data sources (from my desktop), it is working well.

 

1 ACCEPTED SOLUTION
ashwini_bora
Regular Visitor

Thank you for your response..

As I had mentioned before, my Python version and execution is working fine.

 

I was able to resolve the issue by invoking the Power BI app from Python environment from Anaconda command prompt using below-

 

(python37) C:\Users\<myuser>\AppData\Local\Microsoft\WindowsApps>PBIDesktopStore

 

 

View solution in original post

3 REPLIES 3
ashwini_bora
Regular Visitor

Thank you for your response..

As I had mentioned before, my Python version and execution is working fine.

 

I was able to resolve the issue by invoking the Power BI app from Python environment from Anaconda command prompt using below-

 

(python37) C:\Users\<myuser>\AppData\Local\Microsoft\WindowsApps>PBIDesktopStore

 

 

v-luwang-msft
Community Support
Community Support

Hi @ashwini_bora ,

Do you know what version of Python your Anaconda environment is using? It seems will running into issues importing packages with 3.6 and 3.7.This error is due to VS not activating the conda environment before launching the python process.

Try to create a new conda env with Python 3.5:

conda create -n py35 anaconda python=3.5

Then pip installing relevant packages (I had issues with PowerBI recognizing conda installs):

 

conda activate py35
pip install matplotlib
pip install pandas

 

After this is complete, you need to point PowerBI to the new env.

 

Including steps for those less familiar:

File -> Options and Settings -> Options -> Python Scripting

 

Then add the Path to your new Env. Mine looks like:

"C:\ProgramData\Anaconda3\envs\py35"

 

details refer: 

https://developercommunity.visualstudio.com/content/problem/362404/importerrordll-load-failed-the-sp...

https://docs.snowflake.com/en/user-guide/python-connector-example.html 

https://addendanalytics.com/blog/snowflake-dwh-connecting-to-python/ 

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

 

Anonymous
Not applicable

@ashwini_bora  Hi,

 

Try adding a blank query and paste your Python script and make sure you pass the right credentials.

 

Regards,
John Basha Mattipati,
https://www.linkedin.com/in/john-basha-mattipati-06812980/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.