Search code examples
pythonazureraspbianraspberry-pi3

Raspbian Python azure.storage ImportError: No module named cryptography.hazmat.primitives.keywrap


Im trying to upload pictures from my RPi3 to Azure blob storage. Im using raspbian and python moduls as described below.

My problem is that what ever I do I keep getting the following error

>>> from azure.storage import BlobService
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.virtualenvs/azure/lib/python2.7/site-packages/azure_storage-0.33.0-py2.7.egg/azure/storage/__init__.py", line 21, in <module>
from .models import (
  File "/home/pi/.virtualenvs/azure/lib/python2.7/site-packages/azure_storage-0.33.0-py2.7.egg/azure/storage/models.py", line 27, in <module>
from cryptography.hazmat.primitives.keywrap import(
ImportError: No module named cryptography.hazmat.primitives.keywrap

I've tried pip install cryptography and https://pypi.python.org/pypi/azure-storage, but that didn't change anything. I keep getting the same error ImportError: No module named cryptography.hazmat.primitives.keywrap. I even tried just to import azure.storage but that throws the same error.
If anyone could shed some light on how to get azure-storage-blob to work on Raspbian I would be very grateful. Thank you in advance.


Solution

  • You can try to stick to azure-storage 0.32.0 to avoid using cryptography if you don't need the new features of 0.33.0. There is some difficulties to get cryptography working on some system (https://github.com/Azure/azure-storage-python/issues/219)