Python oracle connection script  works in IDLE but not in a toolbox in arcgis

Discussion created by on May 16, 2014
The python code bellow works fine running in IDLE.


import cx_Oracle

connection = cx_Oracle.connect('c##tim/tim@//localhost:1521/xe')
print "Test connection finished"

But when I attach it to a toolbox in arcgis 10.2 I get the following error message:

Traceback (most recent call last):
  File "G:\TIM\Projeto2\Projeto\toolbox\", line 437, in <module>
    connection = cx_Oracle.connect("c##tim/tim@//localhost:1521/xe")
DatabaseError: ORA-06413: Conexão não aberta(Connection not open).

Does anyone have any ideas of what is happening?

Thanks in advance,

Marcus Silva