Python3 安装及常用包安装

一、安装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

你可能感兴趣的:(Python3 安装及常用包安装)