Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.64k stars 2.84k forks source link

BlobServiceClient not available in Azure Notebooks #10914

Closed SeaDude closed 4 years ago

SeaDude commented 4 years ago

Describe the bug

To Reproduce

  1. Run !pip install azure-storage --upgrade and !pip install azure-storage-blob --upgrade in an Azure Notebook
  2. Run from azure.storage.blob import BlobServiceClient (I'm trying to run these instructions to use the BlobServiceClient to interact with Azure Storage)

Expected behavior I'd be able to configure BlobServiceClient per the instructions above

Screenshot image

kaerm commented 4 years ago

@SeaDude thanks for reaching out to us, someone from our team will take a look at this //cc: @rakshith91 @mayurid

lmazuel commented 4 years ago

Hi @SeaDude First azure-storage is an incompatible old version of azure-storage-blob. You cannot install them at the same time, and that will create terrible conflicts. Being default notebooks are shipped with azure-storage-blob, 2.1.0, upgrading just this one with !pip install -U azure-storage-blob should be enough. Could you try and update this thread? Thanks

SeaDude commented 4 years ago

Hi @Imazuel, thanks for the quick reply. - I ran:

!pip uninstall azure-storage --yes
!pip install -U azure-storage-blob
from azure.storage.blob import BlobServiceClient

- Same error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-48fd2e1877c7> in <module>
      1 get_ipython().system('pip uninstall azure-storage --yes')
      2 get_ipython().system('pip install -U azure-storage-blob')
----> 3 from azure.storage.blob import BlobServiceClient

ImportError: cannot import name 'BlobServiceClient'

Here are the results of !pip freeze.

SeaDude commented 4 years ago

To test:

SeaDude commented 4 years ago

Sweeeeeeeet! After installing few missing modules (lining up my previous AN env with the clean one), I'm now able to import BlobServiceClient. Thanks again.

SeaDude commented 4 years ago

Weird... back to same error cannot import name BlockBlobService in Azure Notebooks.. What the heck?

m4rk4l commented 4 years ago

I think this ticket might need to be reopened?

Looked into the source code where BlockBlobService should exist ([__init__.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py) file from azure.storage.blob) but its no longer there.

I tried to get it from my local environment (after using pip to install, got version 12.3.1) but I also did not find it :(

m4rk4l commented 4 years ago

There is new documentation! Also found this ticket