1. 安装locust的准备工作
查看CentOS版本
[root@VM-0-12-centos /]# cat /etc/redhat-release
CentOS Stream release 9
查看python版本(已安装了python)
[root@VM-0-12-centos /]# python --version
Python 3.9.9
查看pip版本(未安装pip)
[root@VM-0-12-centos /]# pip -V
-bash: pip: command not found
[root@VM-0-12-centos /]# pip3 -V
-bash: pip3: command not found
安装pip
[root@VM-0-12-centos /]# yum install -y python3-pip
查看pip是否安装成功
[root@VM-0-12-centos /]# pip -V
pip 21.2.3 from /usr/lib/python3.9/site-packages/pip (python 3.9)
2. 安装locust
查看官方文档
地址如下:https://docs.locust.io/en/stable/installation.html
安装locust
[root@VM-0-12-centos /]# pip3 install locust
查看locust是否安装成功及其版本
[root@VM-0-12-centos /]# locust -V
locust 2.10.1