Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'fcntl' [duplicate]

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'

like image 408
Shubham Singh Avatar asked Jul 08 '20 06:07

Shubham Singh


People also ask

Is the fctnl module available on Windows?

pythonflaskservergunicorn Share Follow asked Jul 8 2020 at 6:15 Shubham SinghShubham Singh 16111 gold badge11 silver badge55 bronze badges 0 Add a comment | 3 Answers 3 ActiveOldestScore 21 The module fctnl is not available on Windows systems Share Follow

Is it possible to use fcntl on Windows?

The fcntl module is not available on Windows. The functionality it exposes does not exist on that platform. If you're trying to lock a file, there are some other Python modules available which provide that functionality. One I've seen referenced in other answers is portalocker. thank you for the reply.

Why can't I import a module in Python?

The name of the module is incorrect The first reason of this error is the name of the module is incorrect, so you have to check out the module name that you had imported. For example, let's try to import os module with double s and see what will happen: as you can see, we got No module named 'oss'.

Why can't I install a module?

1 The name of the module is incorrect 2 The path of the module is incorrect 3 The Library is not installed More ...


2 Answers

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
like image 170
David Airapetyan Avatar answered Sep 21 '22 06:09

David Airapetyan


The module fctnl is not available on Windows systems

like image 39
Necklondon Avatar answered Sep 18 '22 06:09

Necklondon