Skip to content

Published app in Azure fails "Exception: ModuleNotFoundError: No module named 'nltk'" #175

@priyaananthasankar

Description

@priyaananthasankar

Followed instructions to deploy Python functions on Linux Consumption Plan. Function uses NLTK, Spacy, Azure Storage Blob SDK, Azure Cosmos DB Python SDK etc to clean some data from documents.

Works fine locally. Publish does not show any errors - in fact NLTK wheel does get built and packaged as seen from logs

Saved /private/var/folders/8_/8m4c263132g8fwq0ql816zkw0000gn/T/azureworkerxahkly1z/murmurhash-0.28.0.tar.gz
Collecting nltk==3.3 (from -r /Users/prananth/Projects/AcronisProject/requirements.txt (line 23))
Using cached https://files.pythonhosted.org/packages/50/09/3b1755d528ad9156ee7243d52aa5cd2b809ef053a0f31b53d92853dd653a/nltk-3.3.0.zip
Saved /private/var/folders/8_/8m4c263132g8fwq0ql816zkw0000gn/T/azureworkerxahkly1z/nltk-3.3.0.zip

Published to Azure, and tested HTTPTrigger, saw the following error (Please find full error_log attached to this issue)

2018-08-07T22:28:35.071 [Information] Executing 'Functions.CleanData' (Reason='This function was programmatically called via the host APIs.', Id=044c0f45-8db7-4978-875f-34602c477444)
2018-08-07T22:28:35.157 [Error] System.Private.CoreLib: Exception while executing function: Functions.CleanData. System.Private.CoreLib: Result: Failure
Exception: ModuleNotFoundError: No module named 'nltk'
Stack: File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/functions_worker/dispatcher.py", line 202, in _handle__function_load_request
func_request.metadata.script_file)
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/functions_worker/loader.py", line 62, in load_function
mod = importlib.import_module(fullmodname)

error_log.txt

Also please find attached requirements.txt file
requirements.txt

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions