supervisord启动报错报python的错误

Python教程 2023年3月24日 886

简单记录一下,我在centos上安装supervisor启动时报错,下面是错误信息

[root@VM-0-10-centos vhost]# supervisord -c /etc/supervisord.d/supervisord.conf
Traceback (most recent call last):
File "/usr/bin/supervisord", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3260, in <module>
def _initialize_master_working_set():
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'supervisor==3.4.0' distribution was not found and is required by the application

原因分析

由于我将服务器的python版本升级至3.10,而supervisord使用的还是2版本的python,因此启动报错

解决办法

编辑/usr/bin/supervisord文件,将首行python版本改为2,如下

#!/usr/bin/python2


关注微信公众号『PHP学习网

第一时间了解最新网络动态
关注博主不迷路~

PHP学习网:站内收集的部分资源来源于网络,若侵犯了您的合法权益,请联系我们删除!
分享到:
赞(0)

文章评论

您需要之后才可以评论
0点赞 0评论 收藏 QQ分享 微博分享

PHP学习网

PHP学习网