Home > Mobile >  Error running WSGI application: ModuleNotFoundError: No module named '_overlapped'
Error running WSGI application: ModuleNotFoundError: No module named '_overlapped'

Time:02-24

I stuck on this problem. I don't know what should I do. My error throws an error about WSGI. When I saw Error Log, it is working with my local server but getting problem on live

2022-02-23 18:47:32,893: Error running WSGI application
2022-02-23 18:47:32,910: ModuleNotFoundError: No module named '_overlapped'
2022-02-23 18:47:32,910:   File "/var/www/lrnglobal_pythonanywhere_com_wsgi.py", line 17, in <module>
2022-02-23 18:47:32,910:     application = get_wsgi_application()
2022-02-23 18:47:32,910: 
2022-02-23 18:47:32,910:   File "/home/lrnglobal/.virtualenvs/mysite-virtualenv/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2022-02-23 18:47:32,910:     django.setup(set_prefix=False)
2022-02-23 18:47:32,910: 
2022-02-23 18:47:32,910:   File "/home/lrnglobal/.virtualenvs/mysite-virtualenv/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
2022-02-23 18:47:32,910:     apps.populate(settings.INSTALLED_APPS)
2022-02-23 18:47:32,911: 
2022-02-23 18:47:32,911:   File "/home/lrnglobal/.virtualenvs/mysite-virtualenv/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
2022-02-23 18:47:32,911:     app_config.import_models()
2022-02-23 18:47:32,911: 
2022-02-23 18:47:32,911:   File "/home/lrnglobal/.virtualenvs/mysite-virtualenv/lib/python3.9/site-packages/django/apps/config.py", line 301, in import_models
2022-02-23 18:47:32,911:     self.models_module = import_module(models_module_name)
2022-02-23 18:47:32,911: 
2022-02-23 18:47:32,911:   File "/home/lrnglobal/portal/lrnadmin/models.py", line 1, in <module>
2022-02-23 18:47:32,911:     from asyncio.windows_events import NULL
2022-02-23 18:47:32,911: 
2022-02-23 18:47:32,911:   File "/usr/local/lib/python3.9/asyncio/windows_events.py", line 3, in <module>
2022-02-23 18:47:32,911:     import _overlapped
2022-02-23 18:47:32,911: ***************************************************
2022-02-23 18:47:32,912: If you're seeing an import error and don't know why,
2022-02-23 18:47:32,912: we have a dedicated help page to help you debug: 
2022-02-23 18:47:32,912: https://help.pythonanywhere.com/pages/DebuggingImportError/
2022-02-23 18:47:32,912:

this is my working directory enter image description here

and this is my wsgi file it seems correct

import os
import sys
path = '/home/lrnglobal/portal'
if path not in sys.path:
    sys.path.insert(0, path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'portal.settings'

## Uncomment the lines below depending on your Django version
###### then, for Django >=1.5:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
###### or, for older Django <=1.4

Even when I execute the code on console like migrate it also give me the same error I think the issue is in virtual environment but I don't know what is the problem I deleted and create again but no good news enter image description here

CodePudding user response:

Windows specific modules like asyncio.windows_events will not work on PythonAnywhere because it is not Windows based.

CodePudding user response:

You need two modules for that.. robotframework and trollius

pip install trollius
pip install robotframework
  • Related