Skip to content
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

There is a issue with python dotenv restricting Azure Function usage with this SDK #21

Open
polavishnu4444 opened this issue Sep 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@polavishnu4444
Copy link

polavishnu4444 commented Sep 1, 2022

Stability SDK is relying on python-dotenv package which is having or causing issue with its implementation as mentioned in the dotenv github issues here.

It would be helpful to overcome and fix this for the SDK.

Main issue:

Result: Failure Exception: ModuleNotFoundError: No module named 'main' Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 448, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 691, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/HttpTrigger_jetson_01_test/init.py", line 43, in main container_client = adls.get_container_client(place_name) File "/home/site/wwwroot/adls.py", line 14, in get_container_client dotenv.load_dotenv() File "/home/site/wwwroot/.python_packages/lib/site-packages/dotenv/main.py", line 322, in load_dotenv dotenv_path = find_dotenv() File "/home/site/wwwroot/.python_packages/lib/site-packages/dotenv/main.py", line 275, in find_dotenv if usecwd or _is_interactive() or getattr(sys, 'frozen', False): File "/home/site/wwwroot/.python_packages/lib/site-packages/dotenv/main.py", line 272, in _is_interactive main = import('main', None, None, fromlist=['file'])

@dmarx
Copy link
Contributor

dmarx commented Sep 8, 2022

Thanks for reporting this! I poked around and I suspect what's going on is a bug in the azure functions python runtime, which is being fixed presently: Azure/azure-functions-python-worker#1094

that said: I'm pretty sure dotenv isn't a critical dependency, so we may address it on our side as well.

@dmarx dmarx added the bug Something isn't working label Sep 8, 2022
@chigozienri
Copy link
Contributor

chigozienri commented Sep 28, 2022

@polavishnu4444 #66 may solve this, but I don't have an Azure setup to test - could you check out cnri.dotenv-optional (or you can pip install git+https://github.com/Stability-AI/[email protected]) and see if it works in your setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants