This message was deleted.
# ask-for-help
s
This message was deleted.
s
It sounds like there's an issue with the import, does importing your
service.py
work?
s
Do you mean importing service.py from another file?
s
Yeah, or just running import from a python interpreter.
s
Yeah importing service.py to another file works but importing other local files accompanied with init.py doesn't work
s
From python, or from BentoML?
s
I mean from python
Actually there're no errors when running bentoml serve it just hangs infinitly
s
Well, it has to work in Python before it works with BentoML. Sometimes the error isn't surfaced properly by BentoML because the startup hook for Starlette consumed the error silently.
s
Running python service.py seems no problem
"Init: Language setting - universal: true' in the image is just single line print() in my service.py but it keeps printing and bentoml doesn't startup
For example, I have 'util' folder as below and import util or from util import a makes this problem. When I refactor the identical code without init.py solves the problem and bentoml serves well but I don't think it is the ideal solution
Copy code
util
- __init__.py
- a.py
- b.py
s
Does `PYTHONPATH=. python`then
import util
work?
s
importing itself works i can access functions, classes, variables in util but just bentoml doesn't start to serve
s
Ok, I think I misunderstood what you meant earlier. Can you run with --debug and share the output?
s
I'm not sure if screenshot is ok to you. the debug log also prints infinitly
One thing I found was 'No default method found for Runner' is not related with this issue
s
Ah, yeah. I'm trying to reproduce now, though if you could send me a small example that breaks that would be much appreciated.
Hm, yeah, tried making a minimal example with an
__init__.py
, that doesn't seem to be causing any issues.
s
I'm sorry I tested my code more deeply and find out that importing module itself wasn't the problem. importing wandb causes the infinite loop and my modules somehow imports wandb or part of it. Now I can solve the problem just by removing import wandb but may I ask you if you have any guess why importing wandb causes infinite loop.
s
Hm, I'll try that out, thanks for the update! We definitely need to figure out why the server doesn't print any errors at all...
s
Thanks for your support too! As for now I don't have to use wandb and bentoml at the same time so I can just ignore import wandb. But I will be happy to figure out the reason. Thanks!