Oracle - create_engine fails - no attribute 'paramstyle'

175 views
Skip to first unread message

thanos

unread,
Apr 8, 2011, 10:39:33 AM4/8/11
to sqlalchemy
Using cx_oracle presents no problems but when I use

>>>engine = create_engine('oracle://uid:pwd@test1120')
dialect = dialect_cls(**dialect_args)
File "c:\python26\lib\site-packages\sqlalchemy-0.6.4-py2.6.egg
\sqlalchemy\dialects\oracle\cx_oracle.py", line 411, in __init__
OracleDialect.__init__(self, **kwargs)
File "c:\python26\lib\site-packages\sqlalchemy-0.6.4-py2.6.egg
\sqlalchemy\dialects\oracle\base.py", line 637, in __init__
default.DefaultDialect.__init__(self, **kwargs)
File "c:\python26\lib\site-packages\sqlalchemy-0.6.4-py2.6.egg
\sqlalchemy\engine\default.py", line 121, in __init__
self.paramstyle = self.dbapi.paramstyle
AttributeError: 'module' object has no attribute 'paramstyle'


I've tried sqlalchemy-0.7 and have the same problem. The problem seems
to be with the cx_oracle dialect. Is this right ? I don't see any
issues entered in trac - I can't be the only oracle/sqlalchemy user ?
And I know that two years ago this worked....

Michael Bayer

unread,
Apr 8, 2011, 12:30:58 PM4/8/11
to sqlal...@googlegroups.com
that's a cx_oracle problem of some kind (like installation or version). "paramstyle" is a required attribute of a DBAPI and cx_oracle has it:

>>> import cx_Oracle
>>> cx_Oracle.paramstyle
'named'
>>> from sqlalchemy import *


>>> e = create_engine('oracle://uid:pwd@test1120')

>>> e.dialect
<sqlalchemy.dialects.oracle.cx_oracle.OracleDialect_cx_oracle object at 0x27c2f10>
>>> e.dialect.dbapi
<module 'cx_Oracle' from '/Users/classic/.python-eggs/cx_Oracle-5.0.4-py2.7-macosx-10.3-fat.egg-tmp/cx_Oracle.so'>
>>> e.dialect.dbapi.paramstyle
'named'
>>>

> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>

Reply all
Reply to author
Forward
0 new messages