I have the following line of code:
from azure.storage.blob import BlobServiceClient
I get the following error:
from azure.storage.blob import BlobServiceClient
ImportError: cannot import name 'BlobServiceClient' from 'azure.storage.blob' (/home/user-name/.local/lib/python3.7/site-packages/azure/storage/blob/__init__.py)
I have this error BOTH on PythonAnywhere and on my local machine. I am following the tutorial here
I have read through this post on github but to no avail.
What is missing? The objective i am trying to accomplish is to access a blob in a container when I have a URI and a shared key.
Appreciate any help.
The BlobServiceClient allows you to manipulate Azure Storage service resources and blob containers. The storage account provides the top-level namespace for the Blob service.
Can you check pip list
and make sure you have the latest version of azure-storage-blob i.e >= 12.0.0?
BlobServiceClient is introduced in 12.0.0.
If you have an older version, do
pip install azure-storage-blob --upgrade
Also, azure-storage-blob v 12.0.0 and above is moved to a different repository https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob
In my case, I installed azure first and then I got this error. By doing the following steps, and it works fine now:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With