No module named 'fcntl'

 

No module named 'fcntl'

 

import sys

print(sys.path)
for pa in sys.path:
   # print(pa.replace("\\\\","\\"))
   print(pa)

查看的是环境变量:PYTHONPATH

 

解决:

新建一个: fcntl.py文件, 将其存放Python的安装目录: C:\Python27\Lib 下.

该文件里面代码为:

原理:

https://stackoverflow.com/questions/1422368/fcntl-substitute-on-windows/25471508#25471508

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
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页