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: 

Databricks-Sql-Connector

Upendra_Dwivedi
New Contributor II

Hi,

i am connecting with databricks sql_warehouse using vs_code and i am running following command:

 

import os
from databricks import sql

host = 'adb-xxxxxxxxxxx.xx.azuredatabricks.net'
http_path = '/sql/1.0/warehouses/xxxxxxxxxxxxxx'
access_token = 'dapibxxxxxxxxxxxxxxxxxxxxxxxxx'
connection = sql.connect(
  server_hostname=host,
  http_path=http_path,
  access_token=access_token)

cursor = connection.cursor()
 
When i am running this command i am getting 
from databricks.sql.auth.retry import CommandType, DatabricksRetryPolicy
File "C:\Users\Upendra.Dwivedi\OneDrive - xxxxxx\Desktop\Databricks Practice\Sql_Connection_Databricks\.venv\lib\site-packages\databricks\sql\auth\retry.py", line 19, in <module>
from packaging import version
ModuleNotFoundError: No module named 'packaging'

Not able to understand the reason behind this error.
1 REPLY 1

User16502773013
Databricks Employee
Databricks Employee

Hello @Upendra_Dwivedi ,

This is potentially a missing package in your local Python setup, kindly can you check troubleshooting steps here and let me know 

In the alternative this didn't work please share the output of the following commands:

python -V

And

pip freeze > requirements.txt 

Regards

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