cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using databricks-sql-connector in Notebook

wilmorlserios
New Contributor

I am attempting to utilse the databricks-sql-connector python package within a generalised application deployed to run within a Databricks notebook.

 

Upon attempting to import, I am receiving a  module not found error. However, the package is visible when running pip list.

wilmorlserios_0-1740576722972.pngwilmorlserios_1-1740576738825.png

When attempting this import on my local machine where both databricks-sdk and databricks-sql-connector are installed, there are no issue with the above import.

Note, databricks-sql-connector is installed on the compute cluster using a pip requirements file, but databricks-sdk is there as a standard databricks package.

 

Has anybody else had issues when attempting to use databricks-sql-connector within a databricks notebook?

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @wilmorlserios 

The import it's incorrect. It should be:

from databricks import sql

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now