Home > Blockchain >  DJANGO TO HEROKU ImportError win32 only
DJANGO TO HEROKU ImportError win32 only

Time:07-08

I've been trying to upload my first Django project to Heroku. It worked fine until I tried to run the app in heroku.

I am getting this "win32 only" error and I can't seem to find an answer. If you need any further info about the project so here is the GitHub repository: https://github.com/dngbr/Marut.

Exception Type: ImportError
Exception Value:    
win32 only
Exception Location: /app/.heroku/python/lib/python3.10/asyncio/windows_events.py, line 6, in <module>
Python Executable:  /app/.heroku/python/bin/python

CodePudding user response:

You are importing a Windows-specific module in app/views.py:

from asyncio.windows_events import NULL

You aren't using that import, and as you have seen it won't work on Heroku since Heroku doesn't run Windows. I suspect your IDE "helpfully" added this for you, thinking you need it.

Remove that line, commit, and redeploy.

And make sure to review changes as you commit. Try to be aware of the changes that each commit introduces.

  • Related