Error: No module named 'fcntl' Error: No module named 'fcntl' python python

Error: No module named 'fcntl'


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.


What you can do is install importlib with the usual:

pip install importlib

From there use the following:

from importlib import reload

Note that you will need to load your imports as 'modules':

from petshop import parrot as parrot


I got some info from this website https://pypi.org/project/micropython-fcntl/#files and installed as follows which solved the problem:

pip install micropython-fcntl