Skip to content

Local Module import issue #436

@anindya5

Description

@anindya5

Hi,

My issue is if I want to import a function say function1 in module1 of SharedCode, but for me the SharedCode is inside the API folder, like below

FunctionApp
|_ HttpTrigger1
     |_ __init__.py
     |_ function.json
     |_ SharedCode
        |_ module1.py
        |_ module2.py
|_ HttpTrigger2
     |_ __init__.py
     |_ function.json

The various functions I want to run are in module1 and module2

Usually I'd have done
from ShareCode.module1 import function1

That does not work.

from .ShareCode.module1 import function1 also gives module not found error, shown below

Executed 'Functions.HtmBatchAzureFunc' (Failed, Id=d70ee3dc-dca2-4d89-b39c-5c902ed64b11)
[5/22/19 8:54:05 PM] System.Private.CoreLib: Exception while executing function: Functions.HtmBatchAzureFunc. System.Private.CoreLib: Result: Failure
[5/22/19 8:54:05 PM] Exception: ModuleNotFoundError: No module named 'htm_shared_src'
[5/22/19 8:54:05 PM] Stack: File "/usr/local/Cellar/azure-functions-core-tools/2.7.1158/workers/python/deps/azure/functions_worker/dispatcher.py", line 229, in _handle__function_load_request

Can anyone help

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions