from azure.storage.blob.baseblobservice import BaseBlobService - azure

When I try to import BaseBlobService on my IDE (Pycharm), it throw an error: ModuleNotFoundError: No module named 'azure.storage.blob.baseblobservice'
However it works fine on Databricks

Please note that, azure.storage.blob.baseblobservice belongs to azure-storage the older version of Azure Storage SDK. The newer one is azure-storage-blob.
Check whether you are using the older SDK going to this site-packages/azure/storage/blob in your machine and check the blockblobservice.py file.
You can install the latest version of Azure Storage SDK by executing the below command:
pip install azure-storage-blob
And use BlobServiceClient instead of BaseBlobService.
If still the issue persists, try upgrading the SDK like below:
pip install azure-storage-blob --upgrade
And also check whether azure-storage package is installed using pip list, If present the uninstall it.
References:
Getting error No module named 'azure.storage.blob.blockblobservice' while executing on server by Gaurav Mantri
error importing 'BlobServiceClient' from 'azure.storage.blob' by rakshith91

Related

several dependency errors causing in Azure AutoML while running model

I am trying to work on different models on a small piece of ML project which needs to work on azure platform and get the score.py with all the values. It is getting not a single library issue, but getting multiple Module errors and Attribute errors. I am using latest SDK version only, but I am not sure, where I am going side path.
Any previous observations on this error?
The compatibility break is there for the newer version of the packages based on the current version of SDK. If the current SDK version is 1.13.0 and above, previous versions of packages are not in working stage. The compatibility issue is raising because of support of packages from SDK for different versions. It differs from version-to-version package support from SDK.
Because of this we are getting Module not found, ImportError and AttributeError.
This solution depends on the AutoML SDK training version.
If you are using 1.13.0 above version of SDK, update the versions of pandas to 0.25.1 and scikit-learn to 0.22.1
Using the following command in BASH to upgrade the versions.
pip install –upgrade pandas==0.25.1
pip install –upgrade sickit-learn==0.22.1
The generic syntax for upgrading is:
pip install –upgrade package_name==version
If the error occurs in AutoML Configuration file, then need to upgrade that also.
But it is suggestable to uninstall and reinstall AutoMLConfig.
pip uninstall azureml-train automl
Then reinstall using the below code,
pip install azureml-train automl
If you are using windows operating system, then install Miniconda.
If you are a linux user, then using sudo or conda syntaxes for the same operation.
Some of the advanced libraries of computer vision supportive like TensorFlow will be installed by default. Then we need to install them from dependencies.
azureml.core.runconfig import RunConfiguration from
azureml.core.conda_dependencies import CondaDependencies run_config =
RunConfiguration() run_config.environment.python.conda_dependencies =
CondaDependencies.create(conda_packages=['tensorflow==1.12.0'])
Documentation credit to #Larry Franks.

azure blob storage python 2.7

Hi I am using one application which runs fine in windows with python 2.7 , which is copying files to azure blob storage , same setup i am facing issue in linux/ubuntu setup when we try to import below packges:
from azure.storage.blob import ContentSettings
from azure.storage.blob import BlobClient
Error : ImportError: No module named parse
Can someone help in this regard?
Use the latest version via:
pip install azure-storage –upgrade
And also try with this
1. Uninstall azure-storage-blob using: pip uninstall azure-storage-blob.
2. Reinstall azure-storage-blob using: pip install azure-storage-blob.
For more details refer this github issue

Problem updating joblib library from GitHub repo in IBM Watson Studio

In my program, I need to use some joblib functions. However, when I run the program, I get the error message: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23.
Apparently the library has been updated in this Github repo but I did not have success installing the library with the pip install command
I did a test just to install the setup file
pip install https://github.com/dsxuser/scikit-learn/setup.py/0.20.x.zip
but i got 404 error.
What I need is to update all the joblib library in that branch.
Does anyone know how to properly install it?
That's not an error, that's a warning. It tells you that you shouldn't use sklearn.externals.joblib anymore, if you want your code to be compatible with later versions of scikit-learn. Should means that you still can, as long as you do NOT upgrade scikit-learn to 0.23 or later.
The way to make your code ready for later versions of scikit-learn is to not use the deprecated sklearn.externals.joblib, but to use joblib directly instead. It's not pre-installed, so you can do one of these:
conda install joblib
pip install joblib
You didn't mention what part of Watson Studio you are using. If it's notebooks without Spark, the preferred way to install packages is with conda. You can define a custom environment with this customization:
dependencies:
- joblib=0.13.2
or else you can call conda from a notebook cell:
!conda install joblib=0.13.2
If you're using some other part of Watson Studio, give conda a try, and if it doesn't work, switch to pip. Note that pip expects == instead of = before the version number. Specifying the version number protects you from surprises when new versions of joblib are released.

'AWSHTTPSConnection' object has no attribute 'ssl_context'

Not working
root#49161b16e779:/# aws --version
aws-cli/1.11.121 Python/3.5.2 Linux/4.10.0-32-generic botocore/1.5.84
root#49161b16e779:/# aws s3 ls s3://my.bucket.path
'AWSHTTPSConnection' object has no attribute 'ssl_context'
Working fine
tada#tada-VirtualBox:~$ aws --version
aws-cli/1.11.13 Python/3.5.2 Linux/4.10.0-32-generic botocore/1.4.70
The above is a problem I'm getting lately, since somewhere between July 25 and Aug 3, 2017.
Docker is node:6.9.2. Also tried the 'ubuntu' image, same error.
I can't seem to find the error source. Anyone know how to solve it? Thanks.
This is caused by a bug in AWS CLI, noted at https://github.com/boto/botocore/issues/1258#issuecomment-321787841, that mades it incompatible with newer versions of Requests. If you install awscli with Pip, you won't see the bug, because the version that you get from Pip has an old, compatible version of Requests baked into it. But if you've installed AWS CLI with Apt (or perhaps some other package managers), you'll have got a version of AWS CLI that uses the system's Requests module, exposing you to this bug.
To fix, either:
Remove whatever version of the AWS CLI you've got installed and reinstall it with Pip. This probably means running apt remove awscli && pip install awscli.
... OR, if you can't do that for some reason:
Downgrade Requests to version 2.12, which according to https://github.com/boto/botocore/issues/1258#issuecomment-331746809 is compatible with the old versions of AWS CLI, by running pip uninstall requests && pip install requests==2.12 or pip3 uninstall requests && pip3 install requests==2.12.
I believe this issue is fixed as of botocore v1.11.0, so eventually, once the version of awscli in Apt's repositories uses a botocore version >= v1.11.0, this bug should go away.

ImportError: No module named azure.storage.blob (when doing syncdb)

I recently cloned a Django project of mine in a brand new machine, and went about setting up its dependencies. One such dependency was azure storages, for which I followed the advice here and simply did sudo pip install azure.
However, upon `python manage.py syncdb', I keep getting the error:
ImportError: No module named azure.storage.blob
I've tried to solely do sudo pip install azure-storage as well, but this doesn't alleviate my problem either. This shouldn't have been this problematic. What do I do?
As I know, this issue is due to the version of azure storage client library for python.The old version has only one blobservice.py file and
the newest splits it into three files such as blockblobservice.py, pageblobservice.py and appendblobservice.py. So, if you want to use BlockBlobService, you could install azure-storage 0.33.0.
The following steps help you to install azure-storage 0.33.0.
1.You could check the version using pip:
#pip freeze
2.If you see azure==0.11.0 (or any version below 1.0), uninstall it first:
#pip uninstall azure
3.Install azure-storage 0.33.0
#pip install --upgrade azure-storage
You may encounter some error about cryptography, you could run the following command to solve it.
#yum install gcc libffi-devel python-devel openssl-devel
#pip install cryptography
The references:
https://pypi.python.org/pypi/azure-storage
Failed to install Python Cryptography package with PIP and setup.py
Hope it helps. Any concerns, please feel free to let me know.
In my case my file where I was using the statement
from azure.storage.blob import BlobServiceClient
was residing inside azure folder and filename was azure.py too.
After renaming the folder and file, it worked.
Ubuntu 16.04TLS + Python 3.5
Nothing worked for me, however after some fiddling...
sudo pip3 uninstall -y $(pip3 freeze | grep azure)
sudo rm /home/YOUR_ACCOUNT/.local/python3.5/site-packages/azu* -r
sudo pip3 install --upgrade requests
sudo pip3 install azure-storage-blob
You cant use 'pip install azure' instead use the following commends:
pip install azure.storage.blob
and you might need:
pip install azure-storage-file-share

Resources