为python安装cx_oracle [英] install cx_oracle for python
问题描述
在Debian 5上,我一直在尝试为python安装cx_oracle模块,但没有成功.首先,我安装了oracle-xe-client及其依赖项(以下链接中的教程
Am on Debian 5, I've been trying to install cx_oracle module for python without any success. First, I installed oracle-xe-client and its dependency (followed tutorial in the following link here).
然后,我使用了/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin 中的脚本来填充环境变量,例如PATH,ORACLE_HOME和NLS_LANG
Then, I used the scripts in /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin to populate environment variables such as PATH, ORACLE_HOME and NLS_LANG.
完成后,我尝试运行:
sudo easy_install cx_oracle
但是我不断收到以下错误:
But I keep getting the following error:
Searching for cx-oracle
Reading http://pypi.python.org/simple/cx_oracle/
Reading http://cx-oracle.sourceforge.net
Reading http://starship.python.net/crew/atuining
Best match: cx-Oracle 5.0.4
Downloading http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.0.4.tar.gz?download
Processing cx_Oracle-5.0.4.tar.gz
Running cx_Oracle-5.0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xsylvG/cx_Oracle-5.0.4/egg-dist-tmp-8KoqIx
error: cannot locate an Oracle software installation
知道我在这里错过了什么吗?
Any idea what I missed here?
推荐答案
我建议您抓住rpm文件并将其与Alien一起安装.这样,您以后就可以运行apt-get purge no-longer-needed
.
I recommend that you grab the rpm files and install them with alien. That way, you can later on run apt-get purge no-longer-needed
.
在我的情况下,我唯一需要的env变量是LD_LIBRARY_PATH
,所以我做了:
In my case, the only env variable I needed is LD_LIBRARY_PATH
, so I did:
echo export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib >> ~/.bashrc
source ~/.bashrc
在您的情况下,我认为路径变量将为/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib
.
I suppose in your case that path variable will be /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib
.
这篇关于为python安装cx_oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!