我想使用Azure Python API。我使用在linux上安裝Azure Python api:importError:沒有名爲storage.blob的模塊
pip install azure
它沒有問題,按照這些安裝說明https://azure.microsoft.com/en-us/documentation/articles/python-how-to-install/。 (我再次跌破只是跑它顯示的消息,說明它已安裝。)
我要上傳到存儲如下所述: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
由於[官方指南](https://azure.microsoft.com/en-us/documentation/articles/python-how-to-install/)使用[azure-storage sdk](https:// pypi .python.org/pypi/azure-storage)。如果你使用[azure sdk for python](https://github.com/Azure/azure-sdk-for-python),導入代碼應該是這樣的:'from azure.storage import BlobService' –