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

"ModuleNotFoundError: No module named 'health'" #7

Open
novy4 opened this issue Apr 5, 2021 · 2 comments
Open

"ModuleNotFoundError: No module named 'health'" #7

novy4 opened this issue Apr 5, 2021 · 2 comments

Comments

@novy4
Copy link

novy4 commented Apr 5, 2021

I am trying to start health service like:

python3 main.py

I am getting an error:

Traceback (most recent call last):
  File "/usr/lib/python3.8/pkgutil.py", line 493, in find_loader
    spec = importlib.util.find_spec(fullname)
  File "/usr/lib/python3.8/importlib/util.py", line 94, in find_spec
    parent = __import__(parent_name, fromlist=['__path__'])
ModuleNotFoundError: No module named 'health'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "main.py", line 16, in <module>
    app = Flask('health.main')
  File "/home/soltest0/.local/lib/python3.8/site-packages/flask/app.py", line 415, in __init__
    _PackageBoundObject.__init__(
  File "/home/soltest0/.local/lib/python3.8/site-packages/flask/helpers.py", line 980, in __init__
    root_path = get_root_path(self.import_name)
  File "/home/soltest0/.local/lib/python3.8/site-packages/flask/helpers.py", line 786, in get_root_path
    loader = pkgutil.get_loader(import_name)
  File "/usr/lib/python3.8/pkgutil.py", line 479, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python3.8/pkgutil.py", line 499, in find_loader
    raise ImportError(msg.format(fullname, type(ex), ex)) from ex
ImportError: Error while finding loader for 'health.main' (<class 'ModuleNotFoundError'>: No module named 'health')

How can get the health module?
I am running python 3.8

@mattoli829
Copy link

u figure this out? Running into the same issue rn

@JessieJ68683
Copy link

JessieJ68683 commented Apr 27, 2022

Because there is . in health.main, the parent_name will change from health.main to health, so the health module cannot be found. Maybe you can name it health_main

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

No branches or pull requests

3 participants