Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

No module named 'azure' #647

Open Alababdiy opened 4 years ago

Alababdiy commented 4 years ago

is running normal in local but when i deployment in azure app is got :( Application Error

from azure.storage.blob import BlobClient
No module named 'azure'

my requirements.txt file : click==6.7 Flask==1.0.2 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 Werkzeug==0.14.1 azure-storage-blob==12.0.0

(venv) $ pip freeze azure-core==1.1.1 azure-storage-blob==12.1.0 azure-storage-queue==12.1.0 certifi==2019.11.28 cffi==1.13.2 chardet==3.0.4 click==6.7 cryptography==2.8 Flask==1.0.2 idna==2.8 isodate==0.6.0 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 msrest==0.6.10 oauthlib==3.1.0 pycparser==2.19 requests==2.22.0 requests-oauthlib==1.3.0 six==1.13.0 urllib3==1.25.7 Werkzeug==0.14.1

abkosar commented 4 years ago

You don't have azure in your requirements.txt file. Probably you have it in your local environment and that's why it's working locally without problem. So do pip freeze > requirements.txt and update your file and try again. I believe it will work.

Alababdiy commented 4 years ago

i run i try add azure to requirements.txt ( and install in venv ) > pip freeze requirements.txt

but still not working after depoy in webapp

dmgolembiowski commented 4 years ago

@Alababdiy You might need to use the pip installer differently for it to work properly. After you have frozen the installed packages in your local development environment with the commands:

user@computer $ python3 -m venv <directory>
...
user@computer $ source <directory>/bin/activate
(<directory>) user@computer $ pip install azure-storage-blob
...
(<directory>) user@computer $ pip freeze > requirements.txt

And you have uploaded your project to its production environment, then you can go to the application's directory, install your dependencies, and do:

user@server $ source <directory>/bin/activate
(<directory>) user@server $ # 'cd' to the directory with requirements.txt
...
(<directory>) user@server $ pip install -r requirements.txt
daramful commented 3 years ago

@Alababdiy Have you gotten this resolved by any chance?? I'm running into an issue despite adding Azure==4.00 to requirements.txt

xiafu-msft commented 3 years ago

Hi @daramful Have you tried this according to the wiki https://github.com/Azure/azure-storage-python/wiki