標籤:python cx_oracle
1.安裝python
linux 內建安裝了python2.6.6
2.安裝easy_install
按照官網說明,無法安裝
[[email protected] backup]# wget https://bootstrap.pypa.io/ez_setup.py -O - | python
--2014-09-05 16:59:01-- https://bootstrap.pypa.io/ez_setup.py
正在解析主機 bootstrap.pypa.io... 103.245.222.175
正在串連 bootstrap.pypa.io|103.245.222.175|:443... 已串連。
錯誤: 認證通用名 “*.c.ssl.fastly.net” 與所要求的主機名稱 “bootstrap.pypa.io” 不符。
要以不安全的方式串連至 bootstrap.pypa.io,使用‘--no-check-certificate’。
依照提示 用 --no-check-certificate 下載ez_setup.py
[[email protected] backup]# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate
然後 python ez_setup.py 安裝
3. 安裝cx_Oracle
[[email protected] backup]# easy_install cx_Oracle
Searching for cx-Oracle
Reading https://pypi.python.org/simple/cx_Oracle/
Reading http://cx-oracle.sourceforge.net
Reading http://starship.python.net/crew/atuining
Best match: cx-Oracle 5.1.3
Downloading https://pypi.python.org/packages/source/c/cx_Oracle/cx_Oracle-5.1.3.tar.gz#md5=cd6ff16559cbc9c20087ec812c7092ab
Processing cx_Oracle-5.1.3.tar.gz
Writing /tmp/easy_install-qNEdPX/cx_Oracle-5.1.3/setup.cfg
Running cx_Oracle-5.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qNEdPX/cx_Oracle-5.1.3/egg-dist-tmp-7rg1rD
error: cannot locate an Oracle software installation
依照提示,設定好 oracle相關環境
export ORACLE_HOME=/oracle/oracle/product/11.2.3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
python install cx_Oracle