【发布时间】:2017-05-05 16:21:06
【问题描述】:
我正在尝试在运行 Ubuntu 的 EC2 实例上部署 Flask 应用程序。我已经设置了 WSGI 文件,但是在运行 gunicorn 时遇到了一些问题。起初,我用sudo apt-get install gunicorn 安装了gunicorn。但是,它使用错误版本的 python 运行,并且它为我的 Flask 应用程序使用的每个模块引发了导入错误。我确定这是因为我使用 conda 作为环境管理器,并且因为使用apt-get 安装将 gunicorn 置于权限虚拟环境之外。所以,我卸载了 gunicorn (sudo apt-get purge gunicorn) 并通过 conda (conda install gunicorn) 重新安装。现在,当我运行 gunicorn (gunicorn --bind 0.0.0.0:8000 wsgi:app) 时,我没有得到 50 行的回溯。但是,我确实收到以下错误:-bash: /usr/bin/gunicorn: No such file or directory。我尝试卸载 gunicorn 并使用 pip 重新安装,但仍然出现相同的错误。我已经尝试在 Google 和 StackOverflow 上搜索解决方案,但我发现我应该在虚拟环境中安装 gunicorn 来克服这个错误(我相信,我已经在这样做了)。我猜这个问题很容易解决,而且这个问题与我的无能有关,而不是 conda 或其他东西。任何建议将不胜感激。谢谢。
【问题讨论】:
标签: python ubuntu gunicorn conda