如何解决无法在Ubuntu服务器上部署Telegram Bot
嗨,我做了telegram bot
,并尝试将其部署到Ubuntu 18.04
要求:
firebase==3.0.1
firebase-admin==4.3.0
pyTelegramBotAPI==3.7.1
grpcio==1.29.0
requests==2.23.0
我将其安装在服务器上
build-essential
libssl-dev
libffi-dev
python3-pip
python3-dev
python3-setuptools
python3-venv
创建venv之后,我转到/ etc / systemd / system /并创建了uba.service
uba.service
[Unit]
Description=uba
After=network.target
[Service]
User=uba
Group=uba
WorkingDirectory=/home/kokoto/uba/
Environment="PYTHONPATH=/home/kokoto/uba/"
ExecStart=/home/kokoto/uba/.venv/bin/python /home/kokoto/uba/bot_bd.py
[Install]
WantedBy=multi-user.target
但是当我运行机器人时,出现以下错误:
uba.service - uba
Loaded: loaded (/etc/systemd/system/uba.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-09-21 17:48:05 MSK; 16h ago
Process: 10282 ExecStart=/home/kokoto/uba/.venv/bin/python /home/kokoto/uba/bot_bd.py (code=exited,status=216/GROUP)
Main PID: 10282 (code=exited,status=216/GROUP)
Sep 21 17:48:05 s307229 systemd[1]: Started uba.
Sep 21 17:48:05 s307229 systemd[10282]: uba.service: Failed to determine group credentials: No such process
Sep 21 17:48:05 s307229 systemd[10282]: uba.service: Failed at step GROUP spawning /home/kokoto/uba/.venv/bin/python: No such process
Sep 21 17:48:05 s307229 systemd[1]: uba.service: Main process exited,code=exited,status=216/GROUP
Sep 21 17:48:05 s307229 systemd[1]: uba.service: Failed with result 'exit-code'.
解决方法
我不确定,但可能是ubuntu使用python2版本。尝试将python
更改为python3
ExecStart=/home/kokoto/uba/.venv/bin/python3 /home/kokoto/uba/bot_bd.py
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。