1

I have this code running fine on my personal computer

from azure.storage.blob import BlobServiceClient
blob_client = BlobClient.from_blob_url(file_sas)

This is my local envir:

python --version
Python 3.10.4

$ pip show azure.storage.blob
Name: azure-storage-blob
Version: 12.14.1

I have a docker image where I force the same version of azure.storage.blob: Version: 12.14.1. However, my python version is different.

# python3 --version
Python 3.8.10

And in docker I have the following error:

>>> from azure.storage.blob import BlobServiceClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'BlobServiceClient' from 'azure.storage.blob' (/usr/lib/python3/dist-packages/azure/storage/blob/__init__.py)

Any help welcome

3
  • Try to uninstall and then reinstall the module. Try to upgrade to newer version. Commented Jan 12, 2023 at 10:41
  • 1
    If it is 3.8 try to use BlockBlobService Package Commented Jan 12, 2023 at 10:43
  • Can you give me full code and proper process? Commented Jan 12, 2023 at 12:46

1 Answer 1

1

The problem was that my docker image contained a previous older version of the package.

RUN sudo pip uninstall azure-storage-blob -y
RUN python3 -m pip install azure-storage-blob

Fixed it for me

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.