Error installing cx_Oracle

2010-09-22 Thread AMC
Hi,

From last months I am using Python for making small but useful tools
for my team members. I am doing my development in windows machine and
running the program in Solaris machine where Python 2.6.2 is
installed.

In one of my program file I had to use the module cx_Oracle.For that
I have installed the module in my windows machine and done the
programming. But the finished program does not run in Solaris machine,
may be because cx_Oracle was not installed there.Following is the
error shown.

r...@access1:/home/amohan/python/work/broadcast_report/bin$ ./
runsql.py
Traceback (most recent call last):
  File ./runsql.py, line 3, in module
import cx_Oracle
ImportError: ld.so.1: isapython2.6: fatal: /opt/webstack/python/lib/
python2.6/site-packages/cx_Oracle.so: wrong ELF class: ELFCLASS64
r...@access1:/home/amohan/python/work/broadcast_report/bin$

I tried installing cx_Oracle with easy_install utility (I am not
strong in Solaris). While installing I am getting some error as shown
below.

r...@access1:/$ easy_install cx_Oracle
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-FkDQn5/cx_Oracle-5.0.4/egg-dist-tmp-Ogg94s
SessionPool.c, line 200: warning: integer overflow detected: op 
ld: fatal: library -lpython2.6: not found
ld: fatal: File processing errors. No output written to build/
lib.solaris-2.10-i86pc-2.6-10g/cx_Oracle.so
error: Setup script exited with error: command '/opt/webstack/python/
lib/python2.6/pycc' failed with exit status 1
r...@access1:/$

I have searched for a solution everywhere and tried many things but
didn't work. Can somebody help me in this?

Thanks,
AMC.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error installing cx_Oracle

2010-09-22 Thread James Mills
On Wed, Sep 22, 2010 at 9:35 PM, AMC arunmoha...@gmail.com wrote:
 Hi,

 From last months I am using Python for making small but useful tools
 for my team members. I am doing my development in windows machine and
 running the program in Solaris machine where Python 2.6.2 is
 installed.

 In one of my program file I had to use the module cx_Oracle.For that
 I have installed the module in my windows machine and done the
 programming. But the finished program does not run in Solaris machine,
 may be because cx_Oracle was not installed there.Following is the
 error shown.

 r...@access1:/home/amohan/python/work/broadcast_report/bin$ ./
 runsql.py
 Traceback (most recent call last):
  File ./runsql.py, line 3, in module
    import cx_Oracle
 ImportError: ld.so.1: isapython2.6: fatal: /opt/webstack/python/lib/
 python2.6/site-packages/cx_Oracle.so: wrong ELF class: ELFCLASS64
 r...@access1:/home/amohan/python/work/broadcast_report/bin$

 I tried installing cx_Oracle with easy_install utility (I am not
 strong in Solaris). While installing I am getting some error as shown
 below.

 r...@access1:/$ easy_install cx_Oracle
 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-FkDQn5/cx_Oracle-5.0.4/egg-dist-tmp-Ogg94s
 SessionPool.c, line 200: warning: integer overflow detected: op 
 ld: fatal: library -lpython2.6: not found
 ld: fatal: File processing errors. No output written to build/
 lib.solaris-2.10-i86pc-2.6-10g/cx_Oracle.so
 error: Setup script exited with error: command '/opt/webstack/python/
 lib/python2.6/pycc' failed with exit status 1
 r...@access1:/$

 I have searched for a solution everywhere and tried many things but
 didn't work. Can somebody help me in this?

Install the python development libraries.

cheers
James


-- 
-- James Mills
--
-- Problems are solved by method
-- 
http://mail.python.org/mailman/listinfo/python-list


installing cx_Oracle.

2007-05-24 Thread Carl K
I am trying to use this:
http://python.net/crew/atuining/cx_Oracle/html/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/cx-oracle/cx_Oracle-4.3.1.tar.gz?download

[EMAIL PROTECTED]:~/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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
Carl K wrote:
 I am trying to use this:
 http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html
 it is a real module, right?
   
It is indeed.
 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/cx-oracle/cx_Oracle-4.3.1.tar.gz?download

 [EMAIL PROTECTED]:~/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'
   
You have an oracle client installed, right? If not, go get an Instant 
Client:

http://www.*oracle*.com/technology/software/tech/oci/*instant**client*/index.html


Then you need to set an environment variable, ORACLE_HOME, to point to 
the root of the oracle client installation so that the cx_Oracle 
installer can find the oracle libraries to build with.


 Now I don't really know whos problem this is.

 Carl K
   
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Diez B. Roggisch
Carl K schrieb:
 I am trying to use this:
 http://python.net/crew/atuining/cx_Oracle/html/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/cx-oracle/cx_Oracle-4.3.1.tar.gz?download 
 
 
 [EMAIL PROTECTED]:~/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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
Bill Scherer wrote:
 Carl K wrote:
   
 I am trying to use this:
 http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html
 it is a real module, right?
   
 
 It is indeed.
   
 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/cx-oracle/cx_Oracle-4.3.1.tar.gz?download

 [EMAIL PROTECTED]:~/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'
   
 
 You have an oracle client installed, right? If not, go get an Instant 
 Client:

 http://www.*oracle*.com/technology/software/tech/oci/*instant**client*/index.html
   
muh. Sorry for the mangled url. try this one instead:

http://www.oracle.com/technology/software/tech/oci/instantclient/index.html


 Then you need to set an environment variable, ORACLE_HOME, to point to 
 the root of the oracle client installation so that the cx_Oracle 
 installer can find the oracle libraries to build with.

   
 Now I don't really know whos problem this is.

 Carl K
   
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Carl K
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
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
   
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Carl K
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.

[EMAIL PROTECTED]:~/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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Steve Holden
Dennis Lee Bieber wrote:
 On Thu, 24 May 2007 09:07:07 -0500, Carl K [EMAIL PROTECTED]
 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.comsquidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-- Thank You for Reading 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Carl K
Dennis Lee Bieber wrote:
 On Thu, 24 May 2007 09:07:07 -0500, Carl K [EMAIL PROTECTED]
 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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Carsten Haese
On Thu, 2007-05-24 at 16:15 +, Dennis Lee Bieber wrote:
 On Thu, 24 May 2007 09:07:07 -0500, Carl K [EMAIL PROTECTED]
 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:

[EMAIL PROTECTED] ~]$ export FOOD
[EMAIL PROTECTED] ~]$ FOOD=spam
[EMAIL PROTECTED] ~]$ python -c import os; print os.environ['FOOD']
spam
[EMAIL PROTECTED] ~]$ FOOD=eggs
[EMAIL PROTECTED] ~]$ python -c import os; print os.environ['FOOD']
eggs

Regards,

-- 
Carsten Haese
http://informixdb.sourceforge.net


-- 
http://mail.python.org/mailman/listinfo/python-list


RE: installing cx_Oracle.

2007-05-24 Thread Doug Phillips
 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:
 
 [EMAIL PROTECTED] ~]$ export FOOD
 [EMAIL PROTECTED] ~]$ FOOD=spam
 [EMAIL PROTECTED] ~]$ python -c import os; print os.environ['FOOD']
 spam
 [EMAIL PROTECTED] ~]$ FOOD=eggs
 [EMAIL PROTECTED] ~]$ python -c import os; print os.environ['FOOD']
 eggs

Just tried on a FreeBSD 6.1 development box with stock /bin/sh and it
works there too...

... And I just learned something new!
-Doug
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing cx_Oracle.

2007-05-24 Thread Charles Sanders
Doug Phillips wrote:
 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:
[snip]
 Just tried on a FreeBSD 6.1 development box with stock /bin/sh and it
 works there too...

As far as I know, it has been like this since the introduction
of the Bourne shell in (according to a web search) 1979.

Charles
-- 
http://mail.python.org/mailman/listinfo/python-list


installing cx_Oracle on Unix/Solaris

2005-09-27 Thread Steve
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: file /apps/oracle/prod/9.2/lib/libclntsh.so: wrong ELF class: 
 ELFCLASS64

I found the solution on Grig Gheorghiu's blog.  Grig had similar
problems when installing on UNIX, specifically AIX.  You can find his
very useful report on how he solved the problem, here:

http://agiletesting.blogspot.com/2005/05/installing-and-using-cxoracle-on-unix.html

and also here:

http://agiletesting.blogspot.com/2005/07/installing-python-241-and-cxoracle-on.html

To put matters in a nutshell, Oracle 9i installs the 64-bit libraries
in $ORACLE_HOME/lib and the 32-bit libraries in $ORACLE_HOME/lib32.
Since setup.py is looking by default in $ORACLE_HOME/lib, it finds the
64-bit libraries and it fails.

The trick (at least for me) was to change lib to lib32 in my
ORACLE_HOME environment setting, and in setup.py.

MUCH thanks to Grig for his useful blog!

-- 
http://mail.python.org/mailman/listinfo/python-list