gpt4 book ai didi

django - 无法在 Ubuntu 上安装 gunicorn

转载 作者:行者123 更新时间:2023-12-04 18:53:57 27 4
gpt4 key购买 nike

我正在尝试在我的虚拟环境中安装 gunicorn,但得到以下信息:

$ pip 安装 gunicorn

Downloading/unpacking gunicorn
Downloading gunicorn-0.14.2.tar.gz (203Kb): 203Kb downloaded
Running setup.py egg_info for package gunicorn

warning: no files found matching '*' under directory 'debian'
Installing collected packages: gunicorn Found existing installation: gunicorn 0.14.2
Uninstalling gunicorn:
Successfully uninstalled gunicorn
Running setup.py install for gunicorn

warning: no files found matching '*' under directory 'debian'
Installing gunicorn_paster script to /home/aemdy/Documents/projects/reborn/env/bin
Installing gunicorn script to /home/aemdy/Documents/projects/reborn/env/bin
Installing gunicorn_django script to /home/aemdy/Documents/projects/reborn/env/bin
Successfully installed gunicorn
Cleaning up...

当我使用 python manage.py run_gunicorn对于 django,它说这是未知命令。我已将 gunicorn 添加到 INSTALLED_APPS。

最佳答案

安装应用程序时有时会出现类似的警告。我相信这与清理 pip 尝试做的事情有关,但无论如何都没关系。正如控制台输出显示“成功安装 gunicorn”。所以那里没有问题。

安装 gunicorn 后,唯一的其他要求是添加 gunicornINSTALLED_APPS .如果你也这样做了,你就完成了。 run_gunicorn将可用。

因此,如果它不起作用,则以下其中一项正在发挥作用:

  • Gunicorn 实际上并没有安装。但是,尝试在 INSTALLED_APPS 中引用时应该会出错。在那种情况下。检查你的 virtualenv 的 site-packages 目录以确保那里有 gunicorn 文件夹。
  • 您将 Gunicorn 安装在不同的 virtualenv 中。同样,您应该得到一个错误,就像在 #1 中一样。并且,就像 #1 一样,检查以确保它实际上位于正确的 virtualenv 的站点包目录
  • 中。
  • 您没有激活 virtualenv。但是,与 #1 和 #2 相同的错误适用于此。
  • 你真的没有gunicornINSTALLED_APPS或者正在使用的 settings.py 的编译版本在 INSTALLED_APPS 中没有它.删除 settings.pyc如果存在。
  • 关于django - 无法在 Ubuntu 上安装 gunicorn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10110098/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com