离线安装cx_Oracle步骤:
1、系统环境:
Linux环境:Redhat6.5,Python2.7
2、下载软件:
oracle客户端官网下载地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
Python模块cx_Oracle官网下载地址:https://pypi.python.org/pypi/cx_Oracle
3、软件安装:
3.1 oracle客户端安装:
rpm –ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
rpm –ivh oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
rpm –ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
3.2 oracle模块安装:
tar -zxvf cx_Oracle-6.0rc1.tar.gz
python27 setup.py build
python27 setup.py install
4、测试:
进入Python
Python 2.7.13 (default, Apr 6 2017, 12:32:43)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import cx_Oracle
>>> quit();
完成。