一、安装Python3
1、安装依赖包
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
2、下载并解压Python3安装包
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar -zxf Python-3.6.9.tgz
cd Python-3.6.9
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip3
python3 -V
pip3 -V
3、安装常用模块
**# 安装kafka模块**
pip3 install kafka-python
**#安装ES模块**
pip3 install elasticsearch
二、更换默认yum源
1、备份原来的yum源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
2、设置阿里云yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、添加epel
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
4、清理yum缓存、生成新缓存、更新yum源
yum clean all
yum makecache
yum update
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。