Skip to content

Error when calling sql.connect: ModuleNotFoundError: No module named 'packaging' #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edduardoo opened this issue Apr 3, 2025 · 3 comments
Assignees

Comments

@edduardoo
Copy link

edduardoo commented Apr 3, 2025

Code to reproduce

from databricks import sql
sql.connect('my_hostname', 'my_http_path')

Output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<REDACTED>/.venv/lib/python3.11/site-packages/databricks/sql/__init__.py", line 88, in connect
    from .client import Connection
  File "<REDACTED>/.venv/lib/python3.11/site-packages/databricks/sql/client.py", line 24, in <module>
    from databricks.sql.thrift_backend import ThriftBackend
  File "<REDACTED>/.venv/lib/python3.11/site-packages/databricks/sql/thrift_backend.py", line 23, in <module>
    import databricks.sql.auth.thrift_http_client
  File "<REDACTED>/.venv/lib/python3.11/site-packages/databricks/sql/auth/thrift_http_client.py", line 16, in <module>
    from databricks.sql.auth.retry import CommandType, DatabricksRetryPolicy
  File "<REDACTED>/.venv/lib/python3.11/site-packages/databricks/sql/auth/retry.py", line 19, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

Environment:

databricks-sql-connector Version: 4.0.2 (latest)
pip version: 25.0.1
Python version 3.11.9

Current workaround:

Downgraded to version 4.0.0, it works fine.

@madhav-db madhav-db self-assigned this Apr 4, 2025
@madhav-db
Copy link
Contributor

Hey @edduardoo
pip usually comes with packaging module installed. Perhaps there was an error in your installation. Could you try installing it manually via pip install packaging?

@tomboehling
Copy link

In my GitHub Actions environment, it's also missing. Adding packaging to my dependencies resolved the issue, but I think it should be included in this package if it's needed. For instance, wheel also relies on packaging (wheel pyproject)

Environement

pip version: 25.0.1
Python version 3.11.9

[build-system]
requires = ["setuptools==78.1.0", "wheel==0.46.0"]
build-backend = "setuptools.build_meta"

@madhav-db
Copy link
Contributor

Got it, I'll look to add it to our python requirements setup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants