首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >让Django在Ubuntu上使用远程Oracle数据库

让Django在Ubuntu上使用远程Oracle数据库
EN

Stack Overflow用户
提问于 2010-11-17 01:29:24
回答 1查看 909关注 0票数 2

我不知道如何安装Oracle/Python适配器来使其工作。每当我尝试安装cx_Oracle时,我都会得到以下错误:

代码语言:javascript
复制
python setup.py install                                                                                              ~VIRTUAL_ENV/build/cx-oracle
running install
running bdist_egg
running egg_info
creating cx_Oracle.egg-info
writing cx_Oracle.egg-info/PKG-INFO
writing top-level names to cx_Oracle.egg-info/top_level.txt
writing dependency_links to cx_Oracle.egg-info/dependency_links.txt
writing cx_Oracle.egg-info/PKG-INFO
writing top-level names to cx_Oracle.egg-info/top_level.txt
writing dependency_links to cx_Oracle.egg-info/dependency_links.txt
writing manifest file 'cx_Oracle.egg-info/SOURCES.txt'
reading manifest file 'cx_Oracle.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cx_Oracle.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'cx_Oracle' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/demo -I/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public -I/usr/include/python2.6 -c cx_Oracle.c -o build/temp.linux-x86_64-2.6-10g/cx_Oracle.o -DBUILD_VERSION=5.0.4
In file included from /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/oci.h:2655,
                 from cx_Oracle.c:10:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/oci1.h:148: warning: function declaration isn’t a prototype
In file included from /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/ociap.h:222,
                 from /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/oci.h:2679,
                 from cx_Oracle.c:10:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:676: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2667: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2676: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2686: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2695: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2704: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2713: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2721: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2731: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2738: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/nzt.h:2746: warning: function declaration isn’t a prototype
In file included from /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/oci.h:2679,
                 from cx_Oracle.c:10:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/ociap.h:10069: warning: function declaration isn’t a prototype
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public/ociap.h:10075: warning: function declaration isn’t a prototype
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6-10g/cx_Oracle.o -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server -lclntsh -o build/lib.linux-x86_64-2.6-10g/cx_Oracle.so
/usr/bin/ld: skipping incompatible /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/libclntsh.so when searching for -lclntsh
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

下面是我的.bashrc文件中的变量:

代码语言:javascript
复制
# Export Oracle Values
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export ORACLE_SID=XE
export PATH
export LD_LIBRARY_PATH

无论如何,我都要连接到远程Oracle数据库。没有必要在我的本地机器上安装一个。这个是可能的吗?如果是这样,我该怎么做呢?

EN

回答 1

Stack Overflow用户

发布于 2010-11-17 04:51:17

您需要将$ORACLE_HOME/lib添加到LD_LIBRARY_PATH中

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4197075

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档