打包完之后出现:[Errno 2] No such file or directory: ‘d:\Temp_MEI25282\corpwechatbot\token.json’
主要原因是
corpwechatbot下的app.py 中28行:
TOKEN_PATH = CUR_PATH.parent.joinpath(‘token.json’)
添加以下代码:
if not TOKEN_PATH.exists():
TOKEN_PATH.parent.mkdir(parents=True, exist_ok=True)
with open(TOKEN_PATH, 'w') as f:
f.write('{}')
自动创建文件路径与文件内容,就可以解决了;