Cannot import email.mime with Python (v3.6) Azure Function v2
See original GitHub issueFrom @chisqrd on February 14, 2019 20:4
I cannot seem to email from an python azure function on linux consumption plan. I created a function with Visual Studio Code and it does locally run fine.
requirements.txt
has the following
azure-functions==1.0.0b3
azure-functions-worker==1.0.0b3
grpcio==1.14.2
grpcio-tools==1.14.2
protobuf==3.6.1
six==1.12.0
psycopg2==2.7.6.1
azure-keyvault
azure-common
Where it errors out is
from email.mime.multipart import MIMEMultipart
though I did verify right before that email package was in sys.modules.
The error I get is the following
2019-02-14T17:46:30.945 [Error] An error occurred: No module named ‘email.mime’
Is this a known issue or am i missing something?
Copied from original issue: Azure/Azure-Functions#1129
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top GitHub Comments
Apologies for the delay here. I was able to reproduce this issue. You can mitigate it by using the
--no-bundler
flag while publishing. So, you can usefunc azure functionapp publish <appname> --build-native-deps --no-bundler
.We are working on improving our publishing pipeline through platform changes. Until then, please continue to use that flag if you experience issues with certain modules.
Using that flag, you may see some performance decrease (longer cold start). Additional details on the flag can be found here.
Let me know if you continue to see issues after using that flag.
Same issue! Just to prevent this question: No, no file is or was called email.py.