Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cx_Oracle.InterfaceError:unable to acquire envirnoment handle

789319Aug 4 2010 — edited May 19 2011
Hi all,
I am facing this issue with cx_Oracle error like cx_Oracle.InterfaceError:unable to acquire envirnoment handle
using cx_Oracle for windows platform with python version 2.6 . i haved dowload the cx_Oracle with version cx_Oracle-5.0.4-10g win32 py26.msi which is in binary and installed.
Inside the python folder LIB/site packages i found cx_Oracle.pyd file was present with help of this i am able to import the cx_oracle from python prompt

>>import cx_Oracle
This is working fine and its is importing but whenl i am trying to connect to the database through this
>>cx_Oracle.connect()
also with >>cx_Oracle("abc/abc@ORCL")
Traceback <most recent call last>
file "<stdin">,line 1 in <module>
cx_Oracle.InterfaceError:unable to acquire envirnoment handle --> ii am facing this issue i have set the environment path of ORACLE_HOME but still i am facing this issue not able to connect to database

The same which works fine with instanclient version 10.2 without python i am able to connect to database with help of cx_Oracle.connect() but its not same in the python prompt
as i have set all path but still i am facing this issue.

i am using instantclient10g version
os:32bit machine both xp & server2003
location cx_Oracle i downloaded: http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.0.4-10g-unicode.win32-py2.6.msi?download

let me know if any more path or dll i have to include in the python folder





regards
pavanbabu

Edited by: user11419695 on Aug 4, 2010 5:02 AM

Comments

103122
Have you tried setting LD_LIBRARY_PATH=%ORACLE_HOME%/Lib ? I don't know if it will work, but it's a good first thing to try.
On Windows the variable would be PATH
789319
thanks for the reply i tried but it didn't work




pavanbabu g.s
Fahd.Mirza
Hi,
Please make sure that you have full rights and logged in as administrator user. Also check that in the PATH environment variable in Windows, the above mentioned path is included at the front.

regards
862974
I met this issue too and I fixed it.
The issue is that there were several copy of "OCI.dll" exist in different plance and they belong to different Oracle version. I remove the other version's OCI and the app works fine.
Also I use the following setup.py

from distutils.core import setup
import py2exe, sys

sys.argv.append('py2exe')

setup(
options = {'py2exe': {
'bundle_files': 2,
'compressed': True,
'dll_excludes': ["oci.dll"]
}},
console = [{'script': "test.py"}],
zipfile = None
)
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 16 2011
Added on Aug 4 2010
5 comments
17,881 views