Forums

Error running WSGI application - ModuleNotFoundError: No module named 'comment'

Hey Guys I'm new to Pythonanaywhere. I follow the link below https://blog.pythonanywhere.com/121/ however I'm getting the following error message and I can't figure it out.

2019-08-28 18:15:28,297: Error running WSGI application
2019-08-28 18:15:28,299: ModuleNotFoundError: No module named 'comment'
2019-08-28 18:15:28,300:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 18, in <module>
2019-08-28 18:15:28,300:     from comment import app as application  # noqa
2019-08-28 18:15:28,300: ***************************************************
2019-08-28 18:15:28,300: If you're seeing an import error and don't know why,
2019-08-28 18:15:28,300: we have a dedicated help page to help you debug: 
2019-08-28 18:15:28,300: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-08-28 18:15:28,300: ***************************************************
2019-08-28 18:15:31,084: Error running WSGI application
2019-08-28 18:15:31,261: ModuleNotFoundError: No module named 'comment'
2019-08-28 18:15:31,261:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 18, in <module>
2019-08-28 18:15:31,261:     from comment import app as application  # noqa
2019-08-28 18:15:31,261: ***************************************************
2019-08-28 18:15:31,262: If you're seeing an import error and don't know why,
2019-08-28 18:15:31,262: we have a dedicated help page to help you debug: 
2019-08-28 18:15:31,262: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-08-28 18:15:31,262: ***************************************************
2019-08-28 18:15:33,232: Error running WSGI application
2019-08-28 18:15:33,232: ModuleNotFoundError: No module named 'comment'
2019-08-28 18:15:33,233:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 18, in <module>
2019-08-28 18:15:33,233:     from comment import app as application  # noqa
2019-08-28 18:15:33,233: ***************************************************
2019-08-28 18:15:33,233: If you're seeing an import error and don't know why,
2019-08-28 18:15:33,233: we have a dedicated help page to help you debug: 
2019-08-28 18:15:33,233: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-08-28 18:15:33,233: ***************************************************
2019-08-28 18:15:35,116: Error running WSGI application
2019-08-28 18:15:35,117: ModuleNotFoundError: No module named 'comment'
2019-08-28 18:15:35,117:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 18, in <module>
2019-08-28 18:15:35,117:     from comment import app as application  # noqa
2019-08-28 18:15:35,117: ***************************************************
2019-08-28 18:15:35,117: If you're seeing an import error and don't know why,
2019-08-28 18:15:35,117: we have a dedicated help page to help you debug: 
2019-08-28 18:15:35,117: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-08-28 18:15:35,117: ***************************************************
2019-08-28 18:15:35,176: Error running WSGI application
2019-08-28 18:15:35,177: ModuleNotFoundError: No module named 'comment'
2019-08-28 18:15:35,177:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 18, in <module>
2019-08-28 18:15:35,177:     from comment import app as application  # noqa
2019-08-28 18:15:35,178: ***************************************************
2019-08-28 18:15:35,178: If you're seeing an import error and don't know why,
2019-08-28 18:15:35,178: we have a dedicated help page to help you debug: 
2019-08-28 18:15:35,178: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-08-28 18:15:35,179: ***************************************************

[edit by admin: formatting]

It looks like you've changed the WSGI file (the one linked from the "Web" page) and replaced the line that used to say

from flask_app import app as application  # noqa

with one that says

from comment import app as application  # noqa

If you change it back, that error will go away.

Giles:

Could you take a look at this for me? Receiving the following error and yes this? I'm posting the most recent error and the bottom of the log file

2019-09-06 16:31:32,224: Error running WSGI application
2019-09-06 16:31:32,225: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:31:32,226:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:31:32,226:     from comment import app as application
2019-09-06 16:31:32,226: ***************************************************
2019-09-06 16:31:32,226: If you're seeing an import error and don't know why,
2019-09-06 16:31:32,226: we have a dedicated help page to help you debug: 
2019-09-06 16:31:32,226: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:31:32,226: ***************************************************
2019-09-06 16:32:05,514: Error running WSGI application
2019-09-06 16:32:05,517: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:32:05,517:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:32:05,517:     from comment import app as application
2019-09-06 16:32:05,517: ***************************************************
2019-09-06 16:32:05,517: If you're seeing an import error and don't know why,
2019-09-06 16:32:05,517: we have a dedicated help page to help you debug: 
2019-09-06 16:32:05,517: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:32:05,517: ***************************************************
2019-09-06 16:32:41,985: Error running WSGI application
2019-09-06 16:32:41,987: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:32:41,988:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:32:41,988:     from comment import app as application
2019-09-06 16:32:41,988: ***************************************************
2019-09-06 16:32:41,988: If you're seeing an import error and don't know why,
2019-09-06 16:32:41,988: we have a dedicated help page to help you debug: 
2019-09-06 16:32:41,989: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:32:41,989: ***************************************************
2019-09-06 16:34:01,880: Error running WSGI application
2019-09-06 16:34:01,881: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:34:01,882:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:34:01,882:     from comment import app as application
2019-09-06 16:34:01,882: ***************************************************
2019-09-06 16:34:01,882: If you're seeing an import error and don't know why,
2019-09-06 16:34:01,882: we have a dedicated help page to help you debug: 
2019-09-06 16:34:01,882: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:34:01,882: ***************************************************
2019-09-06 16:34:08,287: Error running WSGI application
2019-09-06 16:34:08,287: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:34:08,287:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:34:08,288:     from comment import app as application
2019-09-06 16:34:08,288: ***************************************************
2019-09-06 16:34:08,288: If you're seeing an import error and don't know why,
2019-09-06 16:34:08,288: we have a dedicated help page to help you debug: 
2019-09-06 16:34:08,288: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:34:08,288: ***************************************************
2019-09-06 16:34:08,350: Error running WSGI application
2019-09-06 16:34:08,350: ModuleNotFoundError: No module named 'comment'
2019-09-06 16:34:08,351:   File "/var/www/edavid_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-06 16:34:08,351:     from comment import app as application
2019-09-06 16:34:08,351: ***************************************************
2019-09-06 16:34:08,351: If you're seeing an import error and don't know why,
2019-09-06 16:34:08,351: we have a dedicated help page to help you debug: 
2019-09-06 16:34:08,351: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-09-06 16:34:08,351: ***************************************************

[edit by admin: formatting]

You have this in your WSGI file (the one linked from the "Web" page):

from comment import app as application

Is there a file called "comment.py" that contains your Flask code?

Hello can anyone help to resolve the error below please

Error running WSGI application - ModuleNotFoundError: No module named 'flask_mail' ##

2021-09-09 21:24:33,685: Error running WSGI application
2021-09-09 21:24:33,688: ModuleNotFoundError: No module named 'flask_mail'
2021-09-09 21:24:33,689:   File "/var/www/shaunm_pythonanywhere_com_wsgi.py", line 82, in <module>
2021-09-09 21:24:33,689:     from flaskblog import create_app
2021-09-09 21:24:33,689: 
2021-09-09 21:24:33,689:   File "/home/ShaunM/Flask_Blog_Prod/flaskblog/__init__.py", line 5, in <module>
2021-09-09 21:24:33,689:     from flask_mail import Mail
2021-09-09 21:24:33,690: ***************************************************
2021-09-09 21:24:33,690: If you're seeing an import error and don't know why,
2021-09-09 21:24:33,690: we have a dedicated help page to help you debug: 
2021-09-09 21:24:33,690: https://help.pythonanywhere.com/pages/DebuggingImportError/
2021-09-09 21:24:33,690: ***************************************************
2021-09-09 21:24:54,481: Error running WSGI application
2021-09-09 21:24:54,484: ModuleNotFoundError: No module named 'flask_mail'
2021-09-09 21:24:54,484:   File "/var/www/shaunm_pythonanywhere_com_wsgi.py", line 82, in <module>
2021-09-09 21:24:54,485:     from flaskblog import create_app
2021-09-09 21:24:54,485: 
2021-09-09 21:24:54,485:   File "/home/ShaunM/Flask_Blog_Prod/flaskblog/__init__.py", line 5, in <module>
2021-09-09 21:24:54,485:     from flask_mail import Mail
2021-09-09 21:24:54,485: ***************************************************
2021-09-09 21:24:54,485: If you're seeing an import error and don't know why,
2021-09-09 21:24:54,486: we have a dedicated help page to help you debug: 
2021-09-09 21:24:54,486: https://help.pythonanywhere.com/pages/DebuggingImportError/
2021-09-09 21:24:54,486: ***************************************************
2021-09-09 21:24:58,743: Error running WSGI application
2021-09-09 21:24:58,743: ModuleNotFoundError: No module named 'flask_mail'
2021-09-09 21:24:58,743:   File "/var/www/shaunm_pythonanywhere_com_wsgi.py", line 82, in <module>
2021-09-09 21:24:58,744:     from flaskblog import create_app
2021-09-09 21:24:58,744: 
2021-09-09 21:24:58,744:   File "/home/ShaunM/Flask_Blog_Prod/flaskblog/__init__.py", line 5, in <module>
2021-09-09 21:24:58,744:     from flask_mail import Mail
2021-09-09 21:24:58,744: ***************************************************
2021-09-09 21:24:58,744: If you're seeing an import error and don't know why,
2021-09-09 21:24:58,744: we have a dedicated help page to help you debug: 
2021-09-09 21:24:58,744: https://help.pythonanywhere.com/pages/DebuggingImportError/
2021-09-09 21:24:58,745: ***************************************************

You need to install the Flask-mail package into your account -- see this help page.

Dear All - I successfully installed "yahoofinancials" using "pip3.7 install --user yahoofinancials" (and "pip2.7 install --user yahoofinancials") in the Bash Console, but I am still receiving the errors when I tried to reload the web-app. Can anyone tell me what went wrong? Many thanks!


2021-09-28 02:57:10,586: Error running WSGI application 2021-09-28 02:57:10,592: ModuleNotFoundError: No module named 'yahoofinancials' 2021-09-28 02:57:10,592: File "/var/www/contrendiansia_pythonanywhere_com_wsgi.py", line 16, in <module> 2021-09-28 02:57:10,593: from main import app as application # noqa 2021-09-28 02:57:10,593: 2021-09-28 02:57:10,594: File "/home/CONTRENDIANSIA/main.py", line 11, in <module> 2021-09-28 02:57:10,594: from yahoofinancials import YahooFinancials 2021-09-28 02:57:10,594: ******* 2021-09-28 02:57:10,595: If you're seeing an import error and don't know why, 2021-09-28 02:57:10,595: we have a dedicated help page to help you debug: 2021-09-28 02:57:10,595: https://help.pythonanywhere.com/pages/DebuggingImportError/ 2021-09-28 02:57:10,595: *******

Dear All - I figured it out -- "pip3.8 install --user yahoofinancials"! Need to type in the right Python version that you are using.

But I am still NOT able retrieve financial data from Yahoo! Finance.

Is the api endpoint your package is using whitelisted for free accounts? See https://www.pythonanywhere.com/whitelist/

Thanks Fjl. Let me check them out. Much appreciated.

Good day everyone, I have been unable to access my webpage. I was faced with a 500 server error. The following is the error message logged. I would really appreciate any help would received . The error says:

Error running WSGI application. 
 ModuleNotFoundError: No module named 'livereload'
  File "/var/www/timothynwokeji_pythonanywhere_com_wsgi.py", line 16, in <module>
2022-12-06 10:09:02,593:     application = get_wsgi_application()
2022-12-06 10:09:02,594: 
2022-12-06 10:09:02,594:   File "/home/TimothyNwokeji/.virtualenvs/calc-virtualenv/lib/python3.10/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2022-12-06 10:09:02,594:     return WSGIHandler()
2022-12-06 10:09:02,594: 
2022-12-06 10:09:02,594:   File "/home/TimothyNwokeji/.virtualenvs/calc-virtualenv/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 125, in __init__
2022-12-06 10:09:02,594:     self.load_middleware()
2022-12-06 10:09:02,594: 
2022-12-06 10:09:02,594:   File "/home/TimothyNwokeji/.virtualenvs/calc-virtualenv/lib/python3.10/site-packages/django/core/handlers/base.py", line 40, in load_middleware
2022-12-06 10:09:02,594:     middleware = import_string(middleware_path)
2022-12-06 10:09:02,595: 
2022-12-06 10:09:02,595:   File "/home/TimothyNwokeji/.virtualenvs/calc-virtualenv/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
2022-12-06 10:09:02,595:     return cached_import(module_path, class_name)
2022-12-06 10:09:02,595: 
2022-12-06 10:09:02,595:   File "/home/TimothyNwokeji/.virtualenvs/calc-virtualenv/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
2022-12-06 10:09:02,595:     module = import_module(module_path)

Thanks in advance

[edit by admin: formatting]

Thanks for the message; does livereload appear in your settings.py? If so, where? Is it one of your Django modules?