Databricks-Sql-Connector
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 04:24 AM
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'
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:52 AM - edited 03-21-2025 07:54 AM
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

