473,390 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

installing cx_Oracle.

I am trying to use this:
http://python.net/crew/atuining/cx_O...cx_Oracle.html
it is a real module, right?

sudo easy_install cx_Oracle did not easy_install cx_Oracle.

http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue.

I got the source from
http://prdownloads.sourceforge.net/c...ar.gz?download

carl@dell17:~/a/cx_Oracle-4.3.1$ python setup.py build
Traceback (most recent call last):
File "setup.py", line 36, in ?
oracleHome = os.environ["ORACLE_HOME"]
File "/usr/lib/python2.4/UserDict.py", line 17, in __getitem__
def __getitem__(self, key): return self.data[key]
KeyError: 'ORACLE_HOME'
Now I don't really know whos problem this is.

Carl K
May 24 '07 #1
7 14681
Carl K schrieb:
I am trying to use this:
http://python.net/crew/atuining/cx_O...cx_Oracle.html
it is a real module, right?

sudo easy_install cx_Oracle did not easy_install cx_Oracle.

http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue.

I got the source from
http://prdownloads.sourceforge.net/c...ar.gz?download
carl@dell17:~/a/cx_Oracle-4.3.1$ python setup.py build
Traceback (most recent call last):
File "setup.py", line 36, in ?
oracleHome = os.environ["ORACLE_HOME"]
File "/usr/lib/python2.4/UserDict.py", line 17, in __getitem__
def __getitem__(self, key): return self.data[key]
KeyError: 'ORACLE_HOME'
yours. because you need the oracle OCI with libs and header files
installed + the environment variable ORACLE_HOME pointing to the
installation.

I suggest you download the appropriat oracle instant client for your system.

Diez
May 24 '07 #2
Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
$ python setup.py build
$ sudo python setup.py install

$ python -c "import cx_Oracle"
Traceback (most recent call last):
File "<string>", line 1, in ?
ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or
directory

guessing I need to add
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/
to some path?

btw - anyone know of a .deb that will install this?

Carl K
May 24 '07 #3
Carl K wrote:
Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
$ python setup.py build
$ sudo python setup.py install

$ python -c "import cx_Oracle"
Traceback (most recent call last):
File "<string>", line 1, in ?
ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or
directory

guessing I need to add
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/
to some path?
You can `export
LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib`

or (assuming a recent RedHat linux (or similar) now), put that path in a
file, /etc/ld.so.conf.d/oracle.conf

and run /sbin/ldconfig

You'll find the latter operation to be persistent, and the former is not.
btw - anyone know of a .deb that will install this?

Carl K
May 24 '07 #4
Bill Scherer wrote:
Carl K wrote:
>Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
$ python setup.py build
$ sudo python setup.py install

$ python -c "import cx_Oracle"
Traceback (most recent call last):
File "<string>", line 1, in ?
ImportError: libclntsh.so.10.1: cannot open shared object file: No
such file or directory

guessing I need to add
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/
to some path?
You can `export
LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib`

or (assuming a recent RedHat linux (or similar) now), put that path in a
file, /etc/ld.so.conf.d/oracle.conf

and run /sbin/ldconfig

You'll find the latter operation to be persistent, and the former is not.
>btw - anyone know of a .deb that will install this?

Carl K
bingo.

carl@dell17:~/a/cx_Oracle-4.3.1$ python
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>import cx_Oracle
connection = cx_Oracle.connect('testuserA', 'pw', 'nf55')
cursor = connection.cursor()
cursor.execute("select * from tbl1")
[<cx_Oracle.NUMBER with value None>, <cx_Oracle.FIXED_CHAR with value None>,
<cx_Oracle.NUMBER with value None>]
>>rows=cursor.fetchall()
rows
[(1, 'a ', 1.01), (2, 'a ', 1.02), (3, 'a ', 1.03)]

Thanks - now I can get to the real problem: client side join/order by :)

But I have already done it in MySql, so this should be the easy part...

Thanks again.

Carl K
May 24 '07 #5
Dennis Lee Bieber wrote:
On Thu, 24 May 2007 09:07:07 -0500, Carl K <ca**@personnelware.com>
declaimed the following in comp.lang.python:
>Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

Don't those lines need to be reversed? Set the variable in the
current shell, and /then/ export it?
Modern shells actually allow the single statement

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 24 '07 #6
Dennis Lee Bieber wrote:
On Thu, 24 May 2007 09:07:07 -0500, Carl K <ca**@personnelware.com>
declaimed the following in comp.lang.python:
>Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

Don't those lines need to be reversed? Set the variable in the
current shell, and /then/ export it?
whoops - I may have cut/pasted too fast.

Carl K
May 24 '07 #7
On Thu, 2007-05-24 at 16:15 +0000, Dennis Lee Bieber wrote:
On Thu, 24 May 2007 09:07:07 -0500, Carl K <ca**@personnelware.com>
declaimed the following in comp.lang.python:
Getting closer, thanks Bill and Diez.

$ export ORACLE_HOME
$ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

Don't those lines need to be reversed? Set the variable in the
current shell, and /then/ export it?
It also works the other way around, at least on the non-empty set of
systems that contains my workstation. export simply marks the variable
name for automatic export to the environment of subsequent commands. The
value at that time doesn't matter. What matters is the value that the
name has at the time the command is run:

[carsten@dot ~]$ export FOOD
[carsten@dot ~]$ FOOD=spam
[carsten@dot ~]$ python -c "import os; print os.environ['FOOD']"
spam
[carsten@dot ~]$ FOOD=eggs
[carsten@dot ~]$ python -c "import os; print os.environ['FOOD']"
eggs

Regards,

--
Carsten Haese
http://informixdb.sourceforge.net
May 24 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: GrayGeek | last post by:
After cx_Oracle and the related Oracle tools for Python 2.2.3 + Boa-constructor on Win2000, I added "import cx_Oracle" to the top of a test script. It gives me an error about being unable to find...
8
by: Rodrigo Daunaravicius | last post by:
I can't get this configuration working: cx_Oracle 4.0.1 Oracle 8.0.6 Python 2.3.3 Win NT4.0 SP6fc My first shot at the problem was just running the installation thingie pre-built for...
1
by: Greg Lindstrom | last post by:
>Shouldn't this be '/u01/app/oracle/product/9.2.0' ? Based on the following values, that's what I'd expect. I changed the ORCALE_HOME environment variable to the above suggested value and got a...
1
by: jmdeschamps | last post by:
Hello Having cx_Oracle (an Oracle database connector for Python) used it here where I teach for the last couple of years, and finding it so easy to use (and install) I was taken aback when I got...
0
by: Steve | last post by:
I'm posting this message here, so that someone googling here will be able to find it. I was having problems installing cx_Oracle on Solaris. The build would fail with a message: > ld: fatal:...
4
by: infidel | last post by:
I have a stored procedure that has a single output parameter. Why do I have to pass it a string big enough to hold the value it is to receive? Why can't I pass an empty string or None? >>>...
1
by: Lukas Ziegler | last post by:
Hi, I want to get an access to an oracle database. For that I found the module cx_oracle (http://www.python.net/crew/atuining/cx_Oracle/) and I have installed the version 'Windows Installer...
3
by: Benjamin Hell | last post by:
Hi! I have a problem with the cx_Oracle module (Oracle database access): On a computer with cx_Oracle version 4.1 (Python 2.4.3, Oracle 10g) I can get query results consisting of strings...
2
by: Rhuddlan | last post by:
Hi, I am using RedHat EL 4 and I developed an oracle 10g based application by using cx_Oracle (cx_Oracle-4.3.1-10g-py23-1.i386.rpm) and Python 2.3.4. Running the application through direct...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.