azure-sdk-for-python: BlobServiceClient ImportError: cannot import name 'ParamSpec' from 'typing_extensions'
- Package Name: azure.storage.blob
- Package Version: 12.10.0
- Operating System: Azure Databricks Cluster, DataBricks Runtime 10.3 ML
- Python Version: 3.8
Describe the bug
An ImportError from typing_extensions package shows up when I run from azure.storage.blob import BlobServiceClient
. I run the commands from a Notebook inside the Azure Databricks cluster.
To Reproduce Steps to reproduce the behavior:
- start up a VM with Python3.8 and create a new notebook.
- create a new cell and run
! pip3 install azure-storage-blob
- create a new cell and run
from azure.storage.blob import BlobServiceClient
Expected behavior Be able to import and use the package without any import errors from typing_extensions or any other dependent package.
Screenshots Adding some screenshots of the stack trace
Additional context I fixed the problem in one notebook by doing
%rm -r /databricks/python3/lib/python3.8/site-packages/typing_extensions-4.1.1.dist-info /databricks/python3/lib/python3.8/site-packages/typing_extensions.py
This did not work on a second notebook where I tried it.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 17 (9 by maintainers)
That seems to have resolved it. I can’t call reload(typing_extensions) or it seems to reset some things. But, it is loading the azure python and pip packages now… awesome! Thank you!!
@xiaoyongzhu moving the chat from the PR to this issue:
@xiaoyongzhu thanks for bringing to my attention, as it is still an issue I’m going to re-open this. Can you provide more details on how to set up your Databricks environment? I had previously tried to repro this error in a Databricks notebook with no luck (see above). Are you running this in a notebook? Also which version of
typing-extensions
is getting installed?typing.ParamSpec
was added in Python 3.10, buttyping-extensions
should backport it to as early as 3.6 (looks like you’re using 3.8). While this import works outside of Databricks, I’ll need to investigate why it’s a problem in the Databricks runtime and follow up with the service team.@kristapratico thanks for the response, i found a workaround in the meantime. i will go ahead and file a support issue with Databricks!