0

I'm using notebooks.azure.com to learn python. I'm trying to manage Blobs with python sdk.

MUCH of the documentation I come across mentions pip install azure-storage-blob then using the BlobServiceClient (class?) to interact with Azure Storage.

UNFORTUNATELY, I get the error: ImportError: cannot import name 'BlobServiceClient' when trying to call from azure.storage import BlobServiceClient. This occurs after installing and upgrading azure-storage (v0.36.0) and azure-blob-storage (v12.3.0).

Here is a public Notebook showing the issue

Error in action

Does this mean notebooks.azure.com is using the python v2.1 SDK (which appears to use BlockBlobService instead of BlobServiceClient)

How do I check which version of the python SDK my Azure Notebook is running?

EDIT 1:

  • No change after running !pip install azureml-sdk\[notebooks,automl\] --upgrade

enter image description here

SeaDude
  • 3,725
  • 6
  • 31
  • 68

2 Answers2

0

Did you try

pip install --upgrade azureml-sdk\[notebooks,automl\]
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • Thanks for the reply. However no change. Please see OP `EDIT 1`. – SeaDude Apr 19 '20 at 18:09
  • https://stackoverflow.com/questions/46700157/importerror-cannot-import-name-blobservice-when-using-azure-backend/49487666 – Sajeetharan Apr 19 '20 at 18:11
  • seems like the solution is to create new environment virtualenv --no-site-packages --p python3 myenv – Sajeetharan Apr 19 '20 at 18:12
  • I'm using notebooks.azure.com. If i'm not mistaken, creating a virtualenv doesn't really make sense/isn't possible here. I can't run an Azure Notebook in a given venv because its hosted by Microsoft. I have no perms on the server beyond `user`. I don't think I can use a venv within a notebook to manage packages. – SeaDude Apr 19 '20 at 19:09
0

azure-storage is deprecated, don't use that.

buffalo
  • 36
  • 2
  • 1
    Your answer will be more helpful if you add a link to the depreciation notice, some docs., or any other source you have found the info from or find relevant. – Tibebes. M Sep 14 '20 at 19:16