Forums

ModuleNotFoundError: No module named '_overlapped'

I am trying to deploy django web app I did it several times and each time I got the same error when trying to run the app or makemigrations..

File "/home/maiada/.virtualenvs/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/maiada/.virtualenvs/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
    django.setup()
  File "/home/maiada/.virtualenvs/venv/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/maiada/.virtualenvs/venv/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/maiada/.virtualenvs/venv/lib/python3.9/site-packages/django/apps/config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/maiada/.virtualenvs/venv/Furniture_Project/Product/models.py", line 1, in <module>
    from asyncio.windows_events import NULL
  File "/usr/local/lib/python3.9/asyncio/windows_events.py", line 3, in <module>
    import _overlapped
ModuleNotFoundError: No module named '_overlapped'

PythonAnywhere is not a Windows environment, so Windows-specific APIs like asyncio.windows_events will not work.

@Glenn:

And which is the solution to resolve this issue, I have the same problem and I develop all the app into a windows environment

best regards

If the app needs to run in a Windows environment, you'll need to run it on a Windows machine -- which means that you can't run it on PythonAnywhere.

I dont need to run the app in windows environment but I develop it with VSCode so now I need to deploy it into pythonanywhere environment, is possible to solve the issue, I try several time and always same result

regards

If you're getting the same error, that means that your code uses Windows-specific event loops.