如何为python3安装salt?

如何为python3安装salt?

当我检查我的salt-minion版本时,收到以下消息:

[root@localhost ~]# salt-minion --version
/usr/lib/python2.7/site-packages/salt/scripts.py:198: DeprecationWarning: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as
Python 2.7 won't be maintained after that date.  Salt will drop support for Python 2.7 in the Sodium release or later.
salt-minion 2019.2.0 (Fluorine)

我的问题是:由于 salt 包已自动安装,我该如何为 python3 安装 Salt /usr/lib/python2.7/site-packages/salt/

操作系统是CentOS 7。通过 安装了 salt Yum,来自这个 repo:https://repo.saltstack.com/#rhel

答案1

正如解释的那样https://github.com/saltstack/salt-bootstrap#python-3-support 这仅在某些平台上受支持。

尝试

sh bootstrap-salt.sh -x python3 -D

和/或查看sh bootstrap-salt.sh --help更多详细信息。

答案2

您只需使用 python3 包安装程序 - pip3

yum install python3-pip
pip3 install salt

相关内容