Skip to content

Local Module import issue #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anindya5 opened this issue May 22, 2019 · 3 comments
Closed

Local Module import issue #436

anindya5 opened this issue May 22, 2019 · 3 comments

Comments

@anindya5
Copy link

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

@asavaritayal
Copy link
Contributor

See #374 (comment) for guidance on referencing modules in your function app. Keeping this open to update developer guide with this info.

@asavaritayal asavaritayal self-assigned this May 28, 2019
@asavaritayal asavaritayal modified the milestones: Triaged, Functions Sprint 51 May 28, 2019
@asavaritayal
Copy link
Contributor

@dxkaufman
Copy link

Hi @asavaritayal, I just filed a new issue similar to this one: #577. I have tried following a number of suggestions based on posts here and in the VSC issues list, to no avail, and I'm completely stuck. If you can help me, I'd be hugely grateful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants