我有一段時間試圖安裝cx_Oracle。在Centos 6上安裝cx_Oracle
我試過各種版本的Oracle庫。我最近得到與32位的11.1庫
oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
我必須設置環境變量的: [〜]#集| grep -i oracle PATH =/usr/lib/oracle/11.1/client/lib ORACLE_HOME =/usr/lib/oracle/11.1/client/lib LD_LIBRARY_PATH =/usr/lib/oracle/11.1/client/lib: :/家庭/ sekingerg /斌:/usr/lib64/qt-3.3/bin:在/ usr/local/sbin中:在/ usr/local/bin目錄:/ sbin目錄:/ bin中:/ usr/sbin目錄:在/ usr/bin中:/根/斌:/root/.rvm/bin SQLPATH =/usr/lib目錄/ ORACLE/11.1 /客戶/ lib目錄下:
,當我運行pipinstall,它未能找到包含文件:
[~]# pip install cx_Oracle
Downloading/unpacking cx-Oracle
Running setup.py egg_info for package cx-Oracle
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/cx-Oracle/setup.py", line 180, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/cx-Oracle/setup.py", line 180, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/cx-Oracle
Storing complete log in /root/.pip/pip.log
下面是已安裝的RPM:
[~]# rpm -qa | grep -i oracle
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386
oracle-instantclient11.1-basic-11.1.0.7.0-1.i386
[~]#
我也嘗試安裝cx_Oracle rpm:cx_Oracle-5.1.2-11g-py33-1.x86_64.rpm,但這也不起作用。
[~]# rpm -ipv cx_Oracle-5.1.2-11g-py33-1.x86_64.rpm
Preparing packages for installation...
cx_Oracle-5.1.2-1
但是在安裝之後,仍然無法識別。
[~]# python3
Python 3.3.2 (default, Nov 18 2013, 12:27:03)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'cx_Oracle'
>>>
這確實幫助了很多,但我仍然不能得到模塊正常加載。它找不到像核心庫'$ python3.3 Python 3.3.3(默認,2013年12月2日,16:16:04) [GCC 4.4.7 20120313(Red Hat 4.4.7-4)] on linux 請輸入「help」,「copyright」,「credits」或「license」以獲取更多信息。 >>>進口cx_Oracle 回溯(最近通話最後一個): 文件「」,1號線,在 導入錯誤:libpython3.3m.so.1.0:無法打開共享對象文件:沒有這樣的文件或目錄 > >>任何想法? –
SecondGear