windows下运行python项目,报错ModuleNotFoundError: No module named 'fcntl'

fcntl库是linix的Python发行版才有,windows没有带

方法一

pip安装缺失的包,这个地址去搜索https://libraries.io/search?q=micropython

1
pip install micropython-xxx

仓库地址:https://github.com/micropython/micropython

方法二

在python库文件目录D:\Python\Python38\Lib\site-packages中创建’fcnty文件,内容为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def fcntl(fd, op, arg=0):
return 0

def ioctl(fd, op, arg=0, mutable_flag=True):
if mutable_flag:
return 0
else:
return ""

def flock(fd, op):
return

def lockf(fd, operation, length=0, start=0, whence=0):
return