README.md 1.76 KB

代码生成工具

使用Python Jinja2模板引擎,自动生成代码。

参考资料链接

问题

ModuleNotFoundError: No module named 'flask._compat'

解决方法:

On this specific error: from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat' -

It happened because the python searched on Flask._compat directory and It isn't there, so I changed like on below : (on flask_script/__init__.py)

Where:

`from ._compat import text_type` on original flask-script file

to :

`from flask_script._compat import text_type`

Then It works !!

ModuleNotFoundError: No module named 'fcntl'

解决方法:

输入以下代码并保存至Python安装目录的Lib目录下

LOCK_UN=8
LOCK_EX=2
F_GETFD=1
FD_CLOEXEC=1
F_SETFD=2

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