installing cx_Oracle

Aurelio Martin amartin at wpsnetwork.com
Fri Jun 4 13:47:25 EDT 2004


Rodrigo Daunaravicius wrote:
> 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 win32/python2.3/Oracle8i. It installed with no complaints but
> I can't import the module (can't find OCIEnvCreate entry point in the
> OCI.dll library). 
> This version was built for Oracle 8.1.7, so I figure that must be the
> problem.
> 
> Then I downloaded the sources, but can't build them. After a fair amount of
> fiddling with setup.py and some of the C header files to compensate for the
> unusual file structure of my Oracle Client installation and for the use of
> the gcc compilator instead of Visual Studio, I got stuck at this point:
> 
> :>python setup.py -build -c mingw32 install
> :running build
> :running build_ext
> :building 'cx_Oracle' extension
> :D:\minGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Id:\orant\oci80\include
> :-Id:\orant\rdbms80\demo -ID:\Python23\include -ID:\Python23\PC -c
> :cx_Oracle.c -o build\temp.win32-2.3\Release\cx_oracle.o
> :"-DBUILD_TIME="""June 04, 2004 16:42:10"""
> :In file included from cx_Oracle.c:63:
> :Environment.c: In function `Environment_New':
> :Environment.c:78: warning: implicit declaration of function `OCIEnvCreate'
> :[follows a bunch of declaration errors for anything that's named
> :OCIwhatever]
> 
> 
> According to the Oracle Docs, "OCIEnvCreate creates and initializes an
> environment for OCI functions to work under".
> 
> So my uneducated guess is that this OCIEnvCreate function is not present in
> Oracle 8.0.6, but I can't find anything in the docs that hints to it.
> 
> 
> 1. Is there a way around this OCIEnvCrete problem?
> 
> 2. Is there an alternative to cx_Oracle that works out of the box with
> Oracle 8.0.6? (tryed DCOracle2, but couldn't make it work with Python2.3
> AND without Zope)
> 
> 3. Should I give up cx_Oracle and stick with ODBC?
> 
> 4. Should I give up python and stick with Access VBA? (sorry, bad joke)
> 
> 
> 
> Any insight would be helpful (even another forum where I could forward this
> specific question).
> 
> Thanks in advance,
> Rodrigo Daunaravicius

I had the same problem trying to connect to an Oracle 8.0.5 database. 
The cx_Oracle binary was compiled for Oracle 8i/9i, and it didn't work 
with the Oracle 8.0.5 OCI (Oracle Call Interface). Neither did the 
source (I think it's designed to connect to an 8i/9i OCI, different from 
an 8.0 OCI).


The solution (for me):

I installed an Oracle 8i client in another ORACLE_HOME in the same 
Windows box, and modified the PATH environment variable to put the BIN 
directory of the (new) Oracle 8i ORACLE_HOME before the BIN directory of 
the (old) Oracle 8.0.5 ORACLE_HOME. So, when the cx_Oracle binary looks 
for the OCI, it finds the Oracle8i installation and connects to the 
database.

 From your post, it's not clear to me if you have an Oracle 8.0.6 server 
in your machine, or not. Maybe an Oracle server installation does not 
like the Oracle 8i client installation and the PATH modification that I 
suggest.

Hope this helps

	Aurelio



More information about the Python-list mailing list