宝塔用户_fplahc 发表于 2024-1-9 10:16:06

uWSGI运行flask项目报错找不到application

为了能快速了解并处理您的问题,请提供以下基础信息:面板、插件版本:Linux
系统版本:CentOS 7.9
问题描述:将flask项目上传后在服务器端报错 unable to find "application" callable in file /www/wwwroot/Flask/chatbot.py,在本地以及终端可以直接跑,求解答!Python版本为3.10.0
相关截图(日志、错误):


宝塔用户_fplahc 发表于 2024-1-9 10:17:51

报错代码:
*** Operational MODE: preforking+threaded ***
/www/server/pyporject_evn/Flask_venv/lib/python3.10/site-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
unable to find "application" callable in file /www/wwwroot/Flask/chatbot.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 7030)
spawned uWSGI worker 1 (pid: 7036, cores: 2)
spawned uWSGI worker 2 (pid: 7037, cores: 2)
spawned uWSGI worker 3 (pid: 7039, cores: 2)
spawned uWSGI worker 4 (pid: 7040, cores: 2)
spawned uWSGI http 1 (pid: 7042)

food.x 发表于 2024-1-12 20:35:58

from applications import create_app

application = create_app()


if __name__ == '__main__':
    application.run()
入口代码参考以上方式。
页: [1]
查看完整版本: uWSGI运行flask项目报错找不到application