9
votes

for flask application run using gunicorn

$ pip install gunicorn
$ gunicorn --bind 0.0.0.0:8000 app:app

getting error

Traceback (most recent call last): File "C:\Users\shubham\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\shubham\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\shubham\Desktop\Full_stack_developer\venv\Scripts\gunicorn.exe_main.py", line 5, in File "c:\users\shubham\desktop\full_stack_developer\venv\lib\site-packages\gunicorn\app\wsgiapp.py", line 9, in from gunicorn.app.base import Application File "c:\users\shubham\desktop\full_stack_developer\venv\lib\site-packages\gunicorn\app\base.py", line 11, in from gunicorn import util File "c:\users\shubham\desktop\full_stack_developer\venv\lib\site-packages\gunicorn\util.py", line 9, in import fcntl ModuleNotFoundError: No module named 'fcntl'

3

3 Answers

13
votes

The module fctnl is not available on Windows systems

3
votes

It has already been mentioned in https://stackoverflow.com/a/11087777/12362709 (thanks to @Necklondon) but copying it here since it's useful:

pip install waitress
waitress-serve --listen=*:8000 app:app
0
votes

If you'd like to run gunicorn on windows, this is possible using the Ubuntu terminal available for windows: https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview

The terminal will allow linux commands to work. I use it to run gunicorn myself.