1

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?

1
  • This looks like bug. What version is SQLAlchemy? (import sqlalchemy; print(sqlalchemy.__version__)) If it's old, is there a chance to upgrade? Commented Apr 28, 2017 at 15:22

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.