这个是错误代码
C:\Users\Dell\Desktop\PyInstaller-2.1>computer\dist\computer.exedesktop img saved ok!!!!Traceback (most recent call last): File "", line 84, in File "", line 22, in get_webcamimg File "C:\Users\Dell\Desktop\PyInstaller-2.1\computer\build\computer\out00-PYZ.pyz\VideoCapture", line 50, in __init__ File "C:\Users\Dell\Desktop\PyInstaller-2.1\computer\build\computer\out00-PYZ.pyz\PIL.ImageFont", line 262, in load_pathIOError: cannot find font file
修改python目录中的ImageFont.py中的load_path函数为下面的就可以解决
def load_path(filename): for dir in sys.path: if isDirectory(dir): try: #return load(os.path.join(dir, filename)) return load_default() except IOError: pass raise IOError("cannot find font file")
转载请注明:逝去日子的博客 » python使用pyinstaller生成可执行文件提示错误
友谊之花、爱情之树、以及遗憾之泪!