New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlobServiceClient cannot be imported? #649
Comments
Hi @alla15747 Thanks for reaching out. |
Yes, thank you. absl-py==0.8.1 |
Hi @alla15747 Thanks for the pip result! What was is recommended is:
Let me know if you need any help! |
Hi, I'm having the same issue. Here is the result of pip freeze : Do you know what might be wrong ? |
Having the same issue with version 12.3.0. Any ideas? |
I think the best way to solve it is to create a new virtual env virtualenv --no-site-packages --p python3 myenv and install the packages anew. Make sure that within |
Does this just not work? Like this isn't something conda or pip can solve if you go here this whole piece of great work doesn't work. Where is the proper way of creating an SAS token via python or is that not develop? This is something we would like to use but doesn't seem to be something that can be used. def auth_shared_access_signature(self):
# Instantiate a BlobServiceClient using a connection string
from azure.storage.blob import BlobServiceClient
blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)
# [START create_sas_token]
# Create a SAS token to use to authenticate a new client
from datetime import datetime, timedelta
from azure.storage.blob import ResourceTypes, AccountSasPermissions, generate_account_sas
sas_token = generate_account_sas(
blob_service_client.account_name,
account_key=blob_service_client.credential.account_key,
resource_types=ResourceTypes(object=True),
permission=AccountSasPermissions(read=True),
expiry=datetime.utcnow() + timedelta(hours=1)
)
# [END create_sas_token] |
I'm having the same problem from within Azure Notebooks. Unfortunately, Creating a venv inside the notebook doesn't make sense as I'm not using python in the terminal to execute code, but rather via cells in the Azure Notebook. Note: The venv workaround posted above will not work in Azure Notebooks (as the notebook itself is hosted by Microsoft, there is no option to open it in a venv). |
Even more basic @Jeremy-Demlow , why doesn't this work from within an Azure Notebook:
There seems to be some kind of dependency issue between |
Is there an active solution to this issue without creating a new env ? |
I dont know of one yet, but I did solve this with the method being suggested because that was an option for me. In the end I want to use docker so creating a dedicated env wasn't an issue. But this makes development very difficult and has me looking for very different alternatives because of what is indicative of. |
Any update on this? It has become a blocking issue on several of our notebook demos. It works at first, then fails forever. |
it looks like the original issue is not for azure notebook, would you mind open a new issue? |
Hi @ksaur |
I see, it appears that pip shows |
Hi @ksaur ooh okay gotcha! thanks for finding that! |
Hi Team .. any resolution on this issue ? I tried running a python2 Runbook with similar imports: from azure.storage.blob import BlobServiceClient, generate_account_sas, ResourceTypes, AccountSasPermissions Already imported python2 packages (as per Azure doc). API Version = 2020-01-13-preview |
I had to do the following to get it working. Maybe it might help someone here. |
@prathameshmahankal solution is not working for me, unfortunately. |
@prathameshmahankal that solution worked for me. Thanks. |
@prathameshmahankal This solution really helped, thanks! In my case, I also went through upgrades for other azure related packages. |
-- for azure 4.0.0 , u need to uninstall azure-blob-storage can be 12. or higher it worked for me in databricks |
I am seeing same issue, I tried with latest azure version on python3.8 but didn't work
chandnij@blr-prod-ats-engine-2: |
ImportError Traceback (most recent call last)
in
----> 1 from azure.storage.blob import BlobServiceClient
ImportError: cannot import name 'BlobServiceClient'
The text was updated successfully, but these errors were encountered: