1、操作系统基本环境

centos 7.6 、Python-3.7.6.tgz

2、安装基本组件

yum install  perl-devel zlib-devel perl-ExtUtils-Embed bison flex readline-devel openssl-devel bzip2-devel expat-devel gdbm-devel  sqlite-devel libffi-devel

3、编译安装python3,设置python3环境变量

tar xzvf Python-3.7.6.tgz 
cd Python-3.7.6/
./configure --prefix=/usr/local/python3 --enable-optimizations --with-openssl=/usr/local/openssl
make -j 4
make install
vim /etc/profile

export PATH=/usr/local/python3/bin:$PATH

source /etc/profile

4、安装postgresql开发包和oracle client

yum install postgresql-devel
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip 
mv instantclient_12_2 /usr/local/
cd /usr/local/instantclient_12_2/
ln -s libclntsh.so.12.1 libclntsh.so
ln -s libocci.so.12.1 libocci.so

设置oracle client 环境变量

vim /root/.bashrc 

export LD_LIBRARY_PATH=/usr/local/instantclient_12_2:$LD_LIBRARY_PATH

source /root/.bashrc


vim  /etc/ld.so.conf

/usr/local/instantclient_12_2

ldconfig
ldconfig -p|grep -i oci

libocijdbc12.so (libc6,x86-64) => /usr/local/instantclient_12_2/libocijdbc12.so
libociei.so (libc6,x86-64) => /usr/local/instantclient_12_2/libociei.so

5、下载pip软件包

https://pypi.org/

6、安装pip ,由于软件包存在依赖关系,所以在离线安装的时刻,pandas最后一个安装

pip3 install PyMySQL-0.9.3.tar.gz
pip3 install et_xmlfile-1.0.1.tar.gz
pip3 install six-1.15.0.tar.gz
pip3 install xlrd-1.2.0.tar.gz
pip3 install xlwt-1.3.0.tar.gz
pip3 install jdcal-1.4.1.tar.gz
pip3 install pytz-2020.1.tar.gz
pip3 install SQLAlchemy-1.3.17.tar.gz
pip3 install cx_Oracle-7.3.0.tar.gz
pip3 install setuptools-47.2.0.zip --upgrade
python3 -m pip install pip-20.1.1-py2.py3-none-any.whl --upgrade
pip3 install python_dateutil-2.8.1-py2.py3-none-any.whl 
pip3 install numpy-1.18.5-cp37-cp37m-manylinux1_x86_64.whl
pip3 install openpyxl-3.0.3.tar.gz
pip3 install psycopg2-2.8.5.tar.gz
pip3 install pandas-1.0.4-cp37-cp37m-manylinux1_x86_64.whl

7、确认安装了那些软件包