2

I'm trying to use the Azure Python API. I followed these installation instructions https://azure.microsoft.com/en-us/documentation/articles/python-how-to-install/ using

pip install azure

It had no issues. (I ran it again below just to show the message stating that it is installed. )

I want to upload to Storage as described here: https://azure.microsoft.com/en-us/documentation/articles/storage-python-how-to-use-blob-storage/

$ pip install azure
Requirement already satisfied (use --upgrade to upgrade): azure in ./lib/python2.7/azure-1.0.1-py2.7.egg
...
Requirement already satisfied (use --upgrade to upgrade): azure-storage==0.20.1 in ./lib/python2.7/azure_storage-0.20.1-py2.7.egg (from azure)
...

$ pip install azure-storage
Requirement already satisfied (use --upgrade to upgrade): azure-storage in ./lib/python2.7/azure_storage-0.20.1-py2.7.egg
...

$ python2.7
>>> import azure

/home/path/lib/python2.7/azure_nspkg-1.0.0-py2.7.egg/azure/__init__.py:1: UserWarning: Module azure was already imported from 
...
/home/path/lib/python2.7/azure_nspkg-1.0.0-py2.7.egg/azure/__init__.pyc, but /home/path/lib/python2.7/azure_storage-0.20.1-py2.7.egg is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
...
>>> import azure # a second time just to try it. This time no msg.
>>> from azure.storage.blob import BlobService
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named storage.blob
1

1 Answer 1

2

If you only need azure-storage you should be able to install just that package. If you need storage and other aspects of Azure, then you can just install azure and that will grab everything including storage. No need for both installs.

Particularly if you had an older version of Azure installed before there can be issues with how the dependencies link up. Give pip uninstall azure and pip uninstall azure-storage a try and if you're feeling particularly thorough delete anything prefixed with azure in your python lib folder. Then install just what you need per the first paragraph.

Sign up to request clarification or add additional context in comments.

5 Comments

This was the first time installing Azure-anything so there can't be be any issues with old versions. I started by first installing azure, and only when I got the error, did I then install storage. I do want it all installed.
Hey, that worked! I don't know why it didn't install right the first time. It had added the .egg files, but hadn't dine whatever turns them into the unpackaged library.
Glad it worked. :) Not sure either why the first round of install was unsuccessful.
It doesn't work however if I have a package that has install_requires = [ "azure-storage" ] and run "python setup.py develop". I get the same "No module named storage.blob" error. I would have to "pip uninstall" the azure_* packages, "pip install azure", then "python setup.py develop".
@EmilyGerner-Microsoft: I have a somewhat similar problem that your solution hasn't alleviated. Since you work on Azure Storage client libraries, can you shed some light on it? See here: stackoverflow.com/questions/34405936/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.