安装 python 3
yum install python3 -y
升级 pip 3
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
修改 pip 清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
安装开发套件
yum remove python-devel -y
yum install postgresql11-devel python3-devel gcc gcc-c++ -y
修改环境变量
vi .bash_profile
PATH=$PATH:$HOME/bin:/usr/pgsql-11/bin
source .bash_profile
安装 psycopg2-2.8.5
pip install psycopg2