Django ModuleNotFoundError:没有名为“gunicorn”的模块
我按照[DigitalOcean指南]建立了我的Django网站。它通常工作得很好,但最近我一直遇到这种情况Django ModuleNotFoundError:没有名为“gunicorn”的模块,django,gunicorn,Django,Gunicorn,我按照[DigitalOcean指南]建立了我的Django网站。它通常工作得很好,但最近我一直遇到这种情况 root@localhost:/usr/bin# sudo systemctl status gunicorn Jun 13 21:27:43 localhost systemd[1]: Started gunicorn daemon. Jun 13 21:27:43 localhost gunicorn[20611]: Traceback (most recent call last)
root@localhost:/usr/bin# sudo systemctl status gunicorn
Jun 13 21:27:43 localhost systemd[1]: Started gunicorn daemon.
Jun 13 21:27:43 localhost gunicorn[20611]: Traceback (most recent call last):
Jun 13 21:27:43 localhost gunicorn[20611]: File "/usr/bin/gunicorn", line 6, in <module>
Jun 13 21:27:43 localhost gunicorn[20611]: from gunicorn.app.wsgiapp import run
Jun 13 21:27:43 localhost gunicorn[20611]: ModuleNotFoundError: No module named 'gunicorn'
Jun 13 21:27:43 localhost systemd[1]: gunicorn.service: Main process exited, code=exited, status=1/FAILURE
Jun 13 21:27:43 localhost systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jun 13 21:27:43 localhost systemd[1]: gunicorn.service: Start request repeated too quickly.
Jun 13 21:27:43 localhost systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jun 13 21:27:43 localhost systemd[1]: Failed to start gunicorn daemon.
/etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/home/development/django/
ExecStart=/usr/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
app.wsgi:application
[Install]
WantedBy=multi-user.target
你安装了gunicorn软件包吗?是的,我是pip和其他软件包一起安装的。这就是为什么我在这里添加了哪个gunicorn捕获。说它安装在/usr/bin/gunicorn中你安装了gunicorn软件包吗?是的,我是pip和其他软件包一起安装的。这就是为什么我在这里添加了哪个gunicorn捕获。说它安装在/usr/bin/gunicorn中
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/home/development/django/
ExecStart=/usr/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
app.wsgi:application
[Install]
WantedBy=multi-user.target