[英]Flask app deployment with gunicorn ModuleNotFoundError: No module named 'app'
My web app has the following folder structure:我的 web 应用程序具有以下文件夹结构:
I am using gunicorn command as following, but I am getting the error: ModuleNotFoundError: No module named 'app'
我正在使用 gunicorn 命令如下,但出现错误:
ModuleNotFoundError: No module named 'app'
gunicorn --bind=0.0.0.0 app:app
I also tried: gunicorn --bind=0.0.0.0 /application/app:app
, but I get the same error.我也试过:
gunicorn --bind=0.0.0.0 /application/app:app
,但我得到了同样的错误。
Could you plase help me with the right format/path for gunicorn?你能帮我确定gunicorn的正确格式/路径吗?
With my limited experience on gunicorn, I struggled with the same thing.由于我在 gunicorn 方面的经验有限,我也在为同样的事情苦苦挣扎。 Gunicorn commands do not take well to paths it seems, so just do
Gunicorn 命令似乎不太适合路径,所以就这样做
cd application/光盘应用程序/
then run your command again, it will work now.然后再次运行您的命令,它现在可以工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.