Flask app “Restarting with stat”

Flask app “Restarting with stat”,第1张

最近在运行程序的时候,突然发现程序启动不起来了,系统停在restrating with stat 处就不动了。查了下配置,感觉有可能是flask werkzeug出问题了。

好着的时候,状态应该是这样的:

现在变成了如下:

抄录解决方案如下:

## 方案一:

Check your version of Werkzeug. Version 0.10 was just released and numerous changes went into the reloader. One change is that a default polling reloader is usedthe old pyinotify reloader was apparently inaccurate. If you want more efficient polling, install the  watchdog  package. You can see the code related to this  here .

When Werkzeug can't find watchdog, it uses the stat reloader, otherwise it uses whatever reloader watchdog uses, which can vary by platform. This message is just so you know which one is in use.

## 方案二: 【测试这个方案对我无效,可能和稿轿我用socketio有关系】

Use run(use_reloader=False) to disable the reloader.

It gave me some problems where it wasn't able to find my server file when it restarted. This did the trick. It executed just once and everything worked. Quite odd.

## 方案三:

我发现我猛敬野在配置文件中将开发环境中的debug设为了True,而正式环境中并没有,导致其停滞。所以临时枝喊解决方案是将正式环境中的debug也设置成了True,就能正常运行了。

很早就遇到了这个错误,直到今天才终于拆老搞懂并解决

在计算名带中文字芦喊符的情况下,运行python3.5版本Flask会报类似这样的编码错误: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 0: invalid continuation byte

将计算机名改为全英文陪御野字符,并且重启后即可

Ref: 想请教各位flask中遇到编码问题(python3.5)如何解决?


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12485084.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2025-08-25
下一篇2025-08-25

发表评论

登录后才能评论

评论列表(0条)

    保存