Skip to content
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

Open
Alla-Abdella opened this issue Jan 16, 2020 · 24 comments
Open

BlobServiceClient cannot be imported? #649

Alla-Abdella opened this issue Jan 16, 2020 · 24 comments

Comments

@Alla-Abdella
Copy link


ImportError Traceback (most recent call last)
in
----> 1 from azure.storage.blob import BlobServiceClient

ImportError: cannot import name 'BlobServiceClient'

@xiafu-msft
Copy link
Contributor

Hi @alla15747

Thanks for reaching out.
Would you like to provide your pip freeze result?

@Alla-Abdella
Copy link
Author

Yes, thank you.

absl-py==0.8.1
adal==1.2.2
alabaster==0.7.12
alembic==1.3.0
anaconda-client==1.7.2
anaconda-project==0.8.3
ansiwrap==0.8.4
applicationinsights==0.11.9
asn1crypto==1.0.1
astor==0.8.0
astroid==2.3.1
astropy==3.2.1
atomicwrites==1.3.0
attrs==19.2.0
azure-common==1.1.23
azure-core==1.0.0
azure-graphrbac==0.61.1
azure-mgmt-authorization==0.60.0
azure-mgmt-containerregistry==2.8.0
azure-mgmt-keyvault==2.0.0
azure-mgmt-resource==6.0.0
azure-mgmt-storage==6.0.0
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
azureml-automl-core==1.0.74
azureml-contrib-datadrift==1.0.74
azureml-contrib-interpret==1.0.74
azureml-contrib-notebook==1.0.74
azureml-contrib-opendatasets==1.0.45
azureml-contrib-reinforcementlearning==0.1.0.5919674
azureml-contrib-server==1.0.74
azureml-contrib-services==1.0.74
azureml-core==1.0.74
azureml-datadrift==1.0.74
azureml-dataprep==1.1.30
azureml-dataprep-native==13.1.0
azureml-defaults==1.0.74
azureml-explain-model==1.0.74
azureml-interpret==1.0.74
azureml-mlflow==1.0.74
azureml-model-management-sdk==1.0.1b6.post1
azureml-opendatasets==1.0.74
azureml-pipeline==1.0.74
azureml-pipeline-core==1.0.74
azureml-pipeline-steps==1.0.74
azureml-samples==0+unknown
azureml-sdk==1.0.74
azureml-telemetry==1.0.74
azureml-tensorboard==1.0.74
azureml-train==1.0.74
azureml-train-automl==1.0.74
azureml-train-core==1.0.74
azureml-train-restclients-hyperdrive==1.0.74
azureml-widgets==1.0.74
Babel==2.7.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
backports.tempfile==1.0
backports.weakref==1.0.post1
beautifulsoup4==4.8.0
bitarray==1.0.1
bkcharts==0.2
bleach==3.1.0
bokeh==1.3.4
boto==2.49.0
boto3==1.10.16
botocore==1.13.16
Bottleneck==1.2.1
cachetools==3.1.1
certifi==2019.11.28
cffi==1.12.3
chardet==3.0.4
Click==7.0
cloudpickle==1.2.2
clyent==1.2.2
colorama==0.4.1
configparser==3.7.4
contextlib2==0.6.0
cryptography==2.7
cssselect==1.1.0
cycler==0.10.0
Cython==0.29.13
cytoolz==0.10.0
dask==2.5.2
databricks-cli==0.9.1
decorator==4.4.0
defusedxml==0.6.0
dill==0.3.1.1
distributed==2.5.2
distro==1.4.0
docker==4.1.0
docutils==0.15.2
dotnetcore2==2.1.10
entrypoints==0.3
enum34==1.1.6
et-xmlfile==1.0.1
fastcache==1.1.0
filelock==3.0.12
fire==0.2.1
Flask==1.0.3
fsspec==0.5.2
fusepy==3.0.1
future==0.18.2
gast==0.2.2
gensim==3.8.1
gevent==1.4.0
gitdb2==2.0.6
GitPython==3.0.4
glob2==0.7
gmpy2==2.0.8
google-auth==1.7.0
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
gorilla==0.3.0
greenlet==0.4.15
grpcio==1.25.0
gunicorn==19.9.0
h5py==2.9.0
HeapDict==1.0.1
horovod==0.16.4
html5lib==1.0.1
idna==2.8
imageio==2.6.0
imagesize==1.1.0
imbalanced-learn==0.6.1
importlib-metadata==0.23
interpret-community==0.1.0.3.2
interpret-core==0.1.18
ipykernel==5.1.3
ipython==7.8.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isodate==0.6.0
isort==4.3.21
itsdangerous==1.1.0
jdcal==1.4.1
jedi==0.15.1
jeepney==0.4.1
Jinja2==2.10.3
jmespath==0.9.4
joblib==0.14.0
json-logging-py==0.2
json5==0.8.5
JsonForm==0.0.2
jsonpickle==1.2
jsonschema==3.0.2
JsonSir==0.0.2
jupyter==1.0.0
jupyter-client==5.3.3
jupyter-console==6.0.0
jupyter-core==4.5.0
jupyterlab==0.34.12
jupyterlab-git==0.8.1
jupyterlab-launcher==0.13.1
jupyterlab-server==1.0.6
jupytext==1.2.4
Keras==2.3.1
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
keras2onnx==1.6.0
keyring==18.0.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.2
liac-arff==2.4.0
libarchive-c==2.8
lief==0.9.0
lightgbm==2.3.0
llvmlite==0.29.0
locket==0.2.0
lxml==4.4.1
Mako==1.1.0
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.2
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.0.14
mkl-random==1.1.0
mkl-service==2.3.0
mlflow==1.3.0
mock==3.0.5
more-itertools==7.2.0
mpmath==1.1.0
msgpack==0.6.1
msrest==0.6.10
msrestazure==0.6.2
multimethods==1.0.0
multipledispatch==0.6.0
nbconvert==5.4.1
nbdime==1.1.0
nbformat==4.4.0
ndg-httpsclient==0.5.1
networkx==2.3
nimbusml==1.5.0
nltk==3.4.5
nose==1.3.7
notebook==6.0.0
numba==0.45.1
numexpr==2.7.0
numpy==1.16.2
numpydoc==0.9.1
oauthlib==3.1.0
olefile==0.46
onnx==1.6.0
onnxconverter-common==1.6.0
onnxmltools==1.4.1
openpyxl==3.0.0
opt-einsum==3.1.0
packaging==19.2
pandas==0.23.4
pandas-ml==0.6.1
pandocfilters==1.4.2
papermill==1.2.1
parsel==1.5.2
parso==0.5.1
partd==1.0.0
path.py==12.0.1
pathlib2==2.3.5
pathspec==0.6.0
patsy==0.5.1
pep8==1.7.1
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.2.0
pkginfo==1.5.0.1
pluggy==0.13.0
ply==3.11
pmdarima==1.1.1
prometheus-client==0.7.1
prompt-toolkit==2.0.10
protobuf==3.10.0
psutil==5.6.3
ptyprocess==0.6.0
py==1.8.0
py4j==0.10.7
pyarrow==0.11.1
pyasn1==0.4.7
pyasn1-modules==0.2.7
pycodestyle==2.5.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.3
pydot==1.4.1
pyflakes==2.1.1
Pygments==2.4.2
PyJWT==1.7.1
pylint==2.4.2
pyodbc==4.0.27
pyOpenSSL==19.0.0
pyparsing==2.4.2
pyrsistent==0.15.4
PySocks==1.7.1
pyspark==2.4.4
pytest==5.0.1
pytest-arraydiff==0.3
pytest-astropy==0.5.0
pytest-doctestplus==0.4.0
pytest-openfiles==0.4.0
pytest-remotedata==0.3.2
python-dateutil==2.8.0
Python-EasyConfig==0.1.7
python-editor==1.0.4
pytz==2019.3
PyWavelets==1.0.3
PyYAML==5.1.2
pyzmq==18.1.0
QtAwesome==0.6.0
qtconsole==4.5.5
QtPy==1.9.0
querystring-parser==1.2.4
requests==2.22.0
requests-oauthlib==1.3.0
Resource==0.2.1
rope==0.14.0
rsa==4.0
ruamel-yaml==0.15.46
ruamel.yaml==0.15.89
s3transfer==0.2.1
scikit-image==0.16.2
scikit-learn==0.20.3
scipy==1.1.0
scrapbook==0.2.0
seaborn==0.9.0
SecretStorage==3.1.1
Send2Trash==1.5.0
shap==0.29.3
simplegeneric==0.8.1
simplejson==3.16.0
singledispatch==3.4.0.3
six==1.13.0
skl2onnx==1.4.9
sklearn-pandas==1.7.0
smart-open==1.9.0
smmap2==2.0.5
snowballstemmer==2.0.0
sortedcollections==1.1.2
sortedcontainers==2.1.0
soupsieve==1.9.3
Sphinx==2.2.0
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sphinxcontrib-websupport==1.1.2
spyder==3.3.6
spyder-kernels==0.5.2
SQLAlchemy==1.3.9
sqlparse==0.3.0
statsmodels==0.10.1
sympy==1.4
tables==3.5.2
tabulate==0.8.5
tblib==1.4.0
tenacity==6.0.0
tensorboard==2.0.1
tensorflow-estimator==2.0.1
tensorflow-gpu==2.0.0
termcolor==1.1.0
terminado==0.8.2
testpath==0.4.2
textwrap3==0.9.2
toolz==0.10.0
torch==1.3.1
torchvision==0.2.1
tornado==6.0.3
tqdm==4.36.1
traitlets==4.3.3
typed-ast==1.4.0
typing-extensions==3.7.4.1
unicodecsv==0.14.1
urllib3==1.24.2
w3lib==1.21.0
wcwidth==0.1.7
webencodings==0.5.1
websocket-client==0.56.0
websockets==8.1
Werkzeug==0.16.0
widgetsnbextension==3.5.1
wordcloud==1.6.0
wrapt==1.11.2
wurlitzer==1.0.3
xlrd==1.2.0
XlsxWriter==1.2.1
xlwt==1.3.0
zict==1.0.0
zipp==0.6.0

@xiafu-msft
Copy link
Contributor

xiafu-msft commented Jan 18, 2020

Hi @alla15747

Thanks for the pip result!
It seems you are trying to use azure-storage-blob>=12.0.0 which is in another repo while the old version was installed: azure-storage-blob==2.1.0. The current repo only support azure-storage-blob<=2.1.0 which doesn't have BlobServiceClient.

What was is recommended is:

  1. create a new virtual environment
  2. do pip install azure-storage-blob
  3. follow the readme in another repo to start https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-blob

Let me know if you need any help!

@arbatazi
Copy link

arbatazi commented Mar 4, 2020

Hi,

I'm having the same issue. Here is the result of pip freeze :
adal==1.2.2
aiohttp==3.6.2
alembic==1.4.1
apache-airflow==1.10.9
apispec==1.3.3
argcomplete==1.11.1
asn1crypto==1.3.0
async-timeout==3.0.1
attrs==19.3.0
azure-applicationinsights==0.1.0
azure-batch==4.1.3
azure-common==1.1.24
azure-core==1.2.2
azure-cosmosdb-nspkg==2.0.2
azure-cosmosdb-table==1.0.6
azure-datalake-store==0.0.48
azure-eventgrid==1.3.0
azure-graphrbac==0.40.0
azure-keyvault==1.1.0
azure-loganalytics==0.1.0
azure-mgmt==4.0.0
azure-mgmt-advisor==1.0.1
azure-mgmt-applicationinsights==0.1.1
azure-mgmt-authorization==0.50.0
azure-mgmt-batch==5.0.1
azure-mgmt-batchai==2.0.0
azure-mgmt-billing==0.2.0
azure-mgmt-cdn==3.1.0
azure-mgmt-cognitiveservices==3.0.0
azure-mgmt-commerce==1.0.1
azure-mgmt-compute==4.6.2
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==2.8.0
azure-mgmt-containerservice==4.4.0
azure-mgmt-cosmosdb==0.4.1
azure-mgmt-datafactory==0.6.0
azure-mgmt-datalake-analytics==0.6.0
azure-mgmt-datalake-nspkg==3.0.1
azure-mgmt-datalake-store==0.5.0
azure-mgmt-datamigration==1.0.0
azure-mgmt-devspaces==0.1.0
azure-mgmt-devtestlabs==2.2.0
azure-mgmt-dns==2.1.0
azure-mgmt-eventgrid==1.0.0
azure-mgmt-eventhub==2.6.0
azure-mgmt-hanaonazure==0.1.1
azure-mgmt-iotcentral==0.1.0
azure-mgmt-iothub==0.5.0
azure-mgmt-iothubprovisioningservices==0.2.0
azure-mgmt-keyvault==1.1.0
azure-mgmt-loganalytics==0.2.0
azure-mgmt-logic==3.0.0
azure-mgmt-machinelearningcompute==0.4.1
azure-mgmt-managementgroups==0.1.0
azure-mgmt-managementpartner==0.1.1
azure-mgmt-maps==0.1.0
azure-mgmt-marketplaceordering==0.1.0
azure-mgmt-media==1.0.0
azure-mgmt-monitor==0.5.2
azure-mgmt-msi==0.2.0
azure-mgmt-network==2.7.0
azure-mgmt-notificationhubs==2.1.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-policyinsights==0.1.0
azure-mgmt-powerbiembedded==2.0.0
azure-mgmt-rdbms==1.9.0
azure-mgmt-recoveryservices==0.3.0
azure-mgmt-recoveryservicesbackup==0.3.0
azure-mgmt-redis==5.0.0
azure-mgmt-relay==0.1.0
azure-mgmt-reservations==0.2.1
azure-mgmt-resource==2.2.0
azure-mgmt-scheduler==2.0.0
azure-mgmt-search==2.1.0
azure-mgmt-servicebus==0.5.3
azure-mgmt-servicefabric==0.2.0
azure-mgmt-signalr==0.1.1
azure-mgmt-sql==0.9.1
azure-mgmt-storage==2.0.0
azure-mgmt-subscription==0.2.0
azure-mgmt-trafficmanager==0.50.0
azure-mgmt-web==0.35.0
azure-nspkg==3.0.2
azure-servicebus==0.21.1
azure-servicefabric==6.3.0.0
azure-servicemanagement-legacy==0.20.6
azure-storage-blob==12.2.0
azure-storage-common==1.4.2
azure-storage-file==1.4.0
azure-storage-queue==1.4.0
Babel==2.8.0
backcall==0.1.0
bcrypt==3.1.7
boto==2.49.0
boto3==1.9.162
botocore==1.12.163
cached-property==1.5.1
cattrs==0.9.0
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
Click==7.0
colorama==0.4.3
colorlog==4.0.2
configparser==3.5.3
croniter==0.3.31
cryptography==2.6.1
cycler==0.10.0
Cython==0.29.6
decorator==4.4.0
defusedxml==0.6.0
dill==0.3.1.1
docutils==0.14
Flask==1.1.1
Flask-Admin==1.5.4
Flask-AppBuilder==2.2.4
Flask-Babel==1.0.0
Flask-Caching==1.3.3
Flask-JWT-Extended==3.24.1
Flask-Login==0.4.1
Flask-OpenID==1.2.5
Flask-SQLAlchemy==2.4.1
flask-swagger==0.2.13
Flask-WTF==0.14.3
funcsigs==1.0.2
future==0.16.0
graphviz==0.13.2
gunicorn==19.10.0
idna==2.8
ijson==2.6.1
importlib-metadata==1.5.0
ipykernel==5.1.0
ipython==7.4.0
ipython-genutils==0.2.0
iso8601==0.1.12
isodate==0.6.0
itsdangerous==1.1.0
jedi==0.13.3
Jinja2==2.10.3
jmespath==0.9.4
json-merge-patch==0.2
jsonschema==3.2.0
jupyter-client==5.2.4
jupyter-core==4.4.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
lockfile==0.12.2
Mako==1.1.2
Markdown==2.6.11
MarkupSafe==1.1.1
marshmallow==2.19.5
marshmallow-enum==1.5.1
marshmallow-sqlalchemy==0.22.3
matplotlib==3.0.3
msrest==0.6.11
msrestazure==0.6.2
multidict==4.7.5
numpy==1.16.2
oauthlib==3.1.0
oscrypto==1.2.0
pandas==0.24.2
paramiko==2.7.1
parso==0.3.4
patsy==0.5.1
pendulum==1.4.4
pexpect==4.6.0
pickleshare==0.7.5
prison==0.1.2
prompt-toolkit==2.0.9
psutil==5.7.0
psycopg2==2.7.6.1
ptyprocess==0.6.0
pyarrow==0.13.0
pycparser==2.19
pycryptodomex==3.9.7
pycurl==7.43.0
Pygments==2.3.1
pygobject==3.20.0
PyJWT==1.7.1
PyNaCl==1.3.0
pyOpenSSL==19.0.0
pyparsing==2.4.6
pyrsistent==0.15.7
PySocks==1.6.8
python-apt==1.1.0b1+ubuntu0.16.4.5
python-daemon==2.1.2
python-dateutil==2.8.0
python-editor==1.0.4
python3-openid==3.1.0
pytz==2018.9
pytzdata==2019.3
PyYAML==5.3
pyzmq==18.0.0
requests==2.21.0
requests-oauthlib==1.3.0
s3transfer==0.2.1
scikit-learn==0.20.3
scipy==1.2.1
seaborn==0.9.0
setproctitle==1.1.10
simplejson==3.17.0
six==1.12.0
smart-open==1.9.0
snowflake-connector-python==2.2.1
SQLAlchemy==1.3.13
SQLAlchemy-JSONField==0.9.0
SQLAlchemy-Utils==0.36.1
ssh-import-id==5.5
statsmodels==0.9.0
tabulate==0.8.6
tenacity==4.12.0
termcolor==1.1.0
text-unidecode==1.2
thrift==0.13.0
tornado==6.0.2
traitlets==4.3.2
typing-extensions==3.7.4.1
tzlocal==1.5.1
unattended-upgrades==0.1
unicodecsv==0.14.1
urllib3==1.24.1
virtualenv==16.4.1
wcwidth==0.1.7
Werkzeug==0.16.1
WTForms==2.2.1
yarl==1.4.2
zipp==3.1.0
zope.deprecation==4.4.0

Do you know what might be wrong ?

@hapticPaper
Copy link

Having the same issue with version 12.3.0. Any ideas?

@LemurPwned
Copy link

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 myenv you are using the local pip, not the global one: looking pip freeze and verifying that it is barren prior to installing any packages should be enough.

@Jeremy-Demlow
Copy link

Does this just not work?

Like this isn't something conda or pip can solve

https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/samples/blob_samples_authentication.py#L110

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]

@SeaDude
Copy link

SeaDude commented Apr 19, 2020

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).

@SeaDude
Copy link

SeaDude commented Apr 19, 2020

Even more basic @Jeremy-Demlow , why doesn't this work from within an Azure Notebook:

!pip install azure-storage --upgrade
!pip install azure-storage-blob --upgrade
from azure.storage import BlockBlobService
from azure.storage import BlobServiceClient
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-127-b3e19d311858> in <module>
----> 3 from azure.storage import BlockBlobService

ImportError: cannot import name 'BlockBlobService'

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-134-31a20c93066c> in <module>
----> 4 from azure.storage import BlobServiceClient

ImportError: cannot import name 'BlobServiceClient'

There seems to be some kind of dependency issue between azure-storage, azure-storage-blob, azure-core. Please correct this issue.

@ashikapaul
Copy link

Having the same issue with version 12.3.0. Any ideas?

Is there an active solution to this issue without creating a new env ?

@hapticPaper
Copy link

hapticPaper commented Apr 29, 2020

Having the same issue with version 12.3.0. Any ideas?

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.

@SeaDude
Copy link

SeaDude commented Apr 30, 2020

Just want you guys to know, from within an Azure Notebook, BlobServiceClient is NOT reproducable. Its hit-or-miss whether it will import:
image
It seems to work, THE FIRST TIME, IN A BRAND NEW NOTEBOOK, then fail on subsequent opens of the notebook.
PITA

@ksaur
Copy link

ksaur commented Sep 14, 2020

Any update on this? It has become a blocking issue on several of our notebook demos. It works at first, then fails forever.

@xiafu-msft
Copy link
Contributor

it looks like the original issue is not for azure notebook, would you mind open a new issue?

@xiafu-msft
Copy link
Contributor

xiafu-msft commented Sep 14, 2020

Hi @ksaur
did you install azure-storage? it's not supposed to be there.
Can you paste the pip result here?

@ksaur
Copy link

ksaur commented Sep 14, 2020

I see, it appears that pip shows azure-storage-blob==12.5.0 the first run, and 2.1.0 on subsequent runs. So not a storage issue! I'll coordinate with that team. Thanks!

@xiafu-msft
Copy link
Contributor

xiafu-msft commented Sep 14, 2020

Hi @ksaur

ooh okay gotcha! thanks for finding that!

@rajdurvasula
Copy link

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

But I get the same error.
image

@prathameshmahankal
Copy link

prathameshmahankal commented May 21, 2021

I had to do the following to get it working. Maybe it might help someone here.
pip uninstall -y azure-common azure-storage azure-nspkg azure-storage-blob
pip install azure-storage-blob --upgrade
pip install azure-common --upgrade

@foxale
Copy link

foxale commented May 31, 2021

@prathameshmahankal solution is not working for me, unfortunately.

@george-williamson
Copy link

@prathameshmahankal that solution worked for me. Thanks.

@n-y-kim
Copy link

n-y-kim commented Aug 19, 2022

@prathameshmahankal This solution really helped, thanks!

In my case, I also went through upgrades for other azure related packages.
If you are having this error, try updating... Hope it might help somebody too.

@VikaskumarPatel1595
Copy link

-- for azure 4.0.0 , u need to uninstall azure-blob-storage can be 12. or higher
pip uninstall -y azure-storage-blob
install 1.3.0
pip install azure-storage-blob==1.3.0
upgrade
pip install azure-storage-blob --upgrade

it worked for me in databricks

@cjcode13
Copy link

cjcode13 commented Jan 6, 2023

I am seeing same issue, I tried with latest azure version on python3.8 but didn't work

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

chandnij@blr-prod-ats-engine-2:/Automation/PackageValidation/Scripts$ pip list | grep azure
azure 2.0.0
azure-appconfiguration 1.1.1
azure-batch 3.0.0
azure-cli-command-modules-nspkg 2.0.3
azure-cli-core 2.32.0
azure-cli-nspkg 3.0.2
azure-cli-telemetry 1.0.6
azure-common 1.1.28
azure-core 1.26.0
azure-cosmos 3.2.0
azure-cosmosdb-nspkg 2.0.2
azure-cosmosdb-table 1.0.6
azure-data-tables 12.4.0
azure-datalake-store 0.0.52
azure-eventgrid 0.1.0
azure-graphrbac 0.30.0
azure-identity 1.5.0
azure-keyvault 0.3.7
azure-keyvault-administration 4.0.0b3
azure-keyvault-keys 4.5.1
azure-loganalytics 0.1.1
azure-mgmt 1.0.0
azure-mgmt-advisor 9.0.0
azure-mgmt-apimanagement 3.0.0
azure-mgmt-appconfiguration 2.2.0
azure-mgmt-applicationinsights 1.0.0
azure-mgmt-authorization 0.30.0
azure-mgmt-automation 0.1.1
azure-mgmt-batch 4.0.0
azure-mgmt-batchai 7.0.0b1
azure-mgmt-billing 6.0.0
azure-mgmt-botservice 2.0.0b4
azure-mgmt-cdn 0.30.3
azure-mgmt-cognitiveservices 1.0.0
azure-mgmt-commerce 1.0.1
azure-mgmt-compute 29.0.0
azure-mgmt-consumption 2.0.0
azure-mgmt-containerinstance 9.1.0
azure-mgmt-containerregistry 0.2.1
azure-mgmt-containerservice 16.1.0
azure-mgmt-core 1.3.2
azure-mgmt-cosmosdb 7.0.0
azure-mgmt-databoxedge 1.0.0
azure-mgmt-datafactory 0.4.0
azure-mgmt-datalake-analytics 0.1.6
azure-mgmt-datalake-nspkg 3.0.1
azure-mgmt-datalake-store 0.1.6
azure-mgmt-datamigration 10.0.0
azure-mgmt-deploymentmanager 0.2.0
azure-mgmt-devtestlabs 2.0.0
azure-mgmt-dns 1.0.1
azure-mgmt-documentdb 0.1.3
azure-mgmt-eventgrid 9.0.0
azure-mgmt-eventhub 9.1.0
azure-mgmt-extendedlocation 1.0.0b2
azure-mgmt-hanaonazure 0.1.1
azure-mgmt-hdinsight 9.0.0
azure-mgmt-imagebuilder 1.1.0
azure-mgmt-iotcentral 10.0.0b2
azure-mgmt-iothub 0.2.2
azure-mgmt-iothubprovisioningservices 1.0.0
azure-mgmt-keyvault 0.31.0
azure-mgmt-kusto 0.3.0
azure-mgmt-loganalytics 12.0.0
azure-mgmt-logic 2.1.0
azure-mgmt-machinelearningcompute 0.4.1
azure-mgmt-managedservices 1.0.0
azure-mgmt-managementgroups 1.0.0
azure-mgmt-managementpartner 0.1.1
azure-mgmt-maps 2.0.0
azure-mgmt-marketplaceordering 1.1.0
azure-mgmt-media 7.0.0
azure-mgmt-monitor 0.2.1
azure-mgmt-msi 0.2.0
azure-mgmt-netapp 9.0.1
azure-mgmt-network 1.0.0
azure-mgmt-notificationhubs 1.0.0
azure-mgmt-nspkg 3.0.2
azure-mgmt-policyinsights 1.1.0b3
azure-mgmt-powerbiembedded 1.0.0
azure-mgmt-privatedns 1.0.0
azure-mgmt-rdbms 0.1.0
azure-mgmt-recoveryservices 2.0.0
azure-mgmt-recoveryservicesbackup 4.0.0
azure-mgmt-redhatopenshift 1.1.0
azure-mgmt-redis 4.1.1
azure-mgmt-relay 0.1.0
azure-mgmt-reservations 0.6.0
azure-mgmt-resource 1.1.0
azure-mgmt-scheduler 1.1.3
azure-mgmt-search 8.0.0
azure-mgmt-security 2.0.0b1
azure-mgmt-servermanager 1.2.0
azure-mgmt-servicebus 6.0.0
azure-mgmt-servicefabric 1.0.0
azure-mgmt-servicefabricmanagedclusters 1.0.0
azure-mgmt-servicelinker 1.0.0
azure-mgmt-signalr 1.1.0
azure-mgmt-sql 0.5.3
azure-mgmt-sqlvirtualmachine 1.0.0b4
azure-mgmt-storage 21.0.0
azure-mgmt-subscription 0.5.0
azure-mgmt-synapse 2.1.0b5
azure-mgmt-trafficmanager 0.30.0
azure-mgmt-web 0.32.0
azure-multiapi-storage 0.10.0
azure-nspkg 3.0.2
azure-servicebus 0.21.1
azure-servicefabric 5.6.130
azure-servicemanagement-legacy 0.20.7
azure-storage-blob 1.5.0
azure-storage-common 1.4.2
azure-storage-file 1.4.0
azure-storage-queue 1.4.0
azure-synapse-accesscontrol 0.5.0
azure-synapse-artifacts 0.14.0
azure-synapse-managedprivateendpoints 0.3.0
azure-synapse-spark 0.2.0
azureml 0.2.7
msrestazure 0.6.4
chandnij@blr-prod-ats-engine-2:
/Automation/PackageValidation/Scripts$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests