Reputation: 222
I am trying to connect to my Oracle DB and I can not create the engine:
engine = create_engine('oracle://user:pass@localhost:1521/dbname')
the error I get is:
/anaconda2/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyc in __init__(self, auto_setinputsizes, exclude_setinputsizes, auto_convert_lobs, threaded, allow_twophase, coerce_to_decimal, coerce_to_unicode, arraysize, **kwargs)
705 if hasattr(self.dbapi, 'version'):
706 self.cx_oracle_ver = tuple([int(x) for x in
707 self.dbapi.version.split('.')])
708 else:
709 self.cx_oracle_ver = (0, 0, 0)
ValueError: invalid literal for int() with base 10: '0b1'
My OS: RedHat 7
Oracle Express 11g
Python 2.7 Anaconda
cx_Oracle 6.0
cx_Oracle.clientversion() = (12, 2, 0, 1, 0)
Any Idea how this could be fixed?
Upvotes: 1
Views: 2640
Reputation: 103
This is a bug (or at least an incompatibility) in SQLAlchemy due to the 'b' in cx_Oracle's pre-release version 6.0b1. The issue has been reported here with a suggested fix that you could apply to your own install of SQLAlchemy, or you can wait for a fix to be released. Alternatively, that issue will not be present if you use cx_Oracle version 5.3.
Upvotes: 2