April 19 2016

python安装cx_Oracle

1.要先安装数据库软件,或者数据库的简化的包

2.如果配了yum最好, 如果没有配的话要安装以下的包
openssl-devel i386 0.9.8e-12.el5 rhel 1.9 M
python-devel i386 2.4.3-27.el5 rhel 3.0 M
Installing for dependencies:
e2fsprogs-devel i386 1.39-23.el5 rhel 572 k
keyutils-libs-devel i386 1.2-1.el5 rhel 27 k
krb5-devel i386 1.6.1-36.el5 rhel 1.9 M
libselinux-devel i386 1.33.4-5.5.el5 rhel 144 k
libsepol-devel i386 1.15.2-2.el5 rhel 189 k

gcc-gfortran i386 4.1.2-46.el5 rhel 3.1 M
gcc-gnat i386 4.1.2-46.el5 rhel 11 M
gcc-java i386 4.1.2-46.el5 rhel 2.9 M
gcc-objc i386 4.1.2-46.el5 rhel 2.6 M
gcc-objc++ i386 4.1.2-46.el5 rhel 2.8 M
gcc44 i386 4.4.0-6.el5 rhel 9.6 M
gcc44-c++ i386 4.4.0-6.el5 rhel 4.6 M
gcc44-gfortran i386 4.4.0-6.el5 rhel 4.5 M
Installing for dependencies:
gmp i386 4.1.4-10.el5 rhel 664 k
libgcj-devel i386 4.1.2-46.el5 rhel 1.4 M
libgfortran i386 4.1.2-46.el5 rhel 232 k
libgfortran44 i386 4.4.0-6.el5 rhel 251 k
libgnat i386 4.1.2-46.el5 rhel 989 k
libobjc i386 4.1.2-46.el5 rhel 103 k
libstdc++44-devel i386 4.4.0-6.el5 rhel 4.1 M
zlib-devel i386 1.2.3-3 rhel 101 k

3.下载地址

https://sourceforge.net/projects/cx-oracle/files/?source=navbar

或者你能找到的别的cx_Oracle-5.2.1.tar.gz

cx_Oracle的主页:

http://cx-oracle.sourceforge.net/

4.配置好oracle的环境变量

export PATH=$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME

5.如果没有libclntsh.so ln一下

ln -s libclntsh.so.11.1 libclntsh.so

6.安装

yum install gcc libffi-devel python-devel openssl-devel

yum install -y gcc*

tar -xvf cx_Oracle-5.2.1.tar.gz

python setup.py build install

如果你下的是rpm的话:

rpm -ivh –nodeps cx_Oracle-5.0.1-11g-py24-1.x86_64.rpm

 



Copyright 2019. All rights reserved.

Posted 2016年4月19日 by ucjmh in category "python

Leave a Reply

Your email address will not be published. Required fields are marked *