I have pyodbc 3.0.10, ibm_db_sa 0.3.2, and ibm_db 2.0.6. I'm also
talking to people on the ibm_db list, and they suggested I re-install
ibm_db and ibm_db_sa according to the official tutorial, which uses
easy_install. I did so, but there was no change.

As to pyodbc, I'm fine with not using it. Thus far, from the two lists
I'm on and more research, I thought I *had to* use it to get things
working right. Indeed, when I remove "+pyodbc" from my SA connection
string, the dbms_ver error goes away. However, it's replaced by an
error that the driver can't find the DSN name I give it, even though I
can see that DSN right in the IBM ODBC manager on this computer.
Someone mentioned 64-bit versus 32-bit; I'm using the 64-bit version
of the ODBC manager, and 64-bit Python. I'm not sure how else to tell
if the name of the DSN itself is in the correct format.

The traceback is very long, but here it is in full:

c:\python27\python.exe DBInterface2.py
Traceback (most recent call last):
  File "DBInterface2.py", line 28, in <module>
    getAllTables()
  File "DBInterface2.py", line 22, in getAllTables
    dbInspector = reflection.Inspector.from_engine(dbEngine)
  File "c:\python27\lib\site-packages\sqlalchemy\engine\reflection.py", line 135
, in from_engine
    return Inspector(bind)
  File "c:\python27\lib\site-packages\sqlalchemy\engine\reflection.py", line 109
, in __init__
    bind.connect().close()
  File "c:\python27\lib\site-packages\sqlalchemy\engine\base.py", line 2018, in
connect
    return self._connection_cls(self, **kwargs)
  File "c:\python27\lib\site-packages\sqlalchemy\engine\base.py", line 72, in __
init__
    if connection is not None else engine.raw_connection()
  File "c:\python27\lib\site-packages\sqlalchemy\engine\base.py", line 2104, in
raw_connection
    self.pool.unique_connection, _connection)
  File "c:\python27\lib\site-packages\sqlalchemy\engine\base.py", line 2074, in
_wrap_pool_connect
    return fn()
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 318, in unique_c
onnection
    return _ConnectionFairy._checkout(self)
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 713, in _checkou
t
    fairy = _ConnectionRecord.checkout(pool)
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 480, in checkout

    rec = pool._do_get()
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 1060, in _do_get

    self._dec_overflow()
  File "c:\python27\lib\site-packages\sqlalchemy\util\langhelpers.py", line 60,
in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 1057, in _do_get

    return self._create_connection()
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 323, in _create_
connection
    return _ConnectionRecord(self)
  File "c:\python27\lib\site-packages\sqlalchemy\pool.py", line 454, in __init__

    exec_once(self.connection, self)
  File "c:\python27\lib\site-packages\sqlalchemy\event\attr.py", line 246, in ex
ec_once
    self(*args, **kw)
  File "c:\python27\lib\site-packages\sqlalchemy\event\attr.py", line 256, in __
call__
    fn(*args, **kw)
  File "c:\python27\lib\site-packages\sqlalchemy\util\langhelpers.py", line 1312
, in go
    return once_fn(*arg, **kw)
  File "c:\python27\lib\site-packages\sqlalchemy\engine\strategies.py", line 165
, in first_connect
    dialect.initialize(c)
  File "c:\python27\lib\site-packages\sqlalchemy\connectors\pyodbc.py", line 154
, in initialize
    super(PyODBCConnector, self).initialize(connection)
  File "c:\python27\lib\site-packages\ibm_db_sa-0.3.2-py2.7.egg\ibm_db_sa\base.p
y", line 666, in initialize
    self.dbms_ver = connection.connection.dbms_ver
AttributeError: 'pyodbc.Connection' object has no attribute 'dbms_ver'


On 2/15/16, Simon King <si...@simonking.org.uk> wrote:
> What does the traceback say? That exact line would trigger an error much
> like the one you are seeing, if the object in “connection.connection” is a
> pyodbc.Connection and doesn’t have a “dbms_ver” attribute.
>
> Note that there are at least 3 packages that could be involved here:
>
> pyodbc (https://pypi.python.org/pypi/pyodbc)
>
> ibm_db (https://pypi.python.org/pypi/ibm_db/)
>
> ibm_db_sa (https://pypi.python.org/pypi/ibm_db_sa)
>
> What versions do you have of each of them? Note that
> https://github.com/ibmdb/python-ibmdbsa/tree/master/ibm_db_sa says that
> pyodbc support is experimental.
>
> Simon
>
>> On 15 Feb 2016, at 21:07, Alex Hall <ah...@autodist.com> wrote:
>>
>> I just downloaded a fresh copy of 0.3.2, just in case I had somehow
>> gotten an old version from Pip. I looked in base.py, and found:
>>
>> def initialize(self, connection):
>>       super(DB2Dialect, self).initialize(connection)
>>        self.dbms_ver = connection.connection.dbms_ver
>>
>> While I'm not sure what I can do about it, it looks like this dbms_ver
>> property is definitely in the latest ibm_db_sa version. Am I getting
>> this from the wrong place, or confusing this with a different package
>> somehow? I *must* be missing something obvious.
>>
>> On 2/15/16, Alex Hall <ah...@autodist.com> wrote:
>>> An interesting development. I noticed that in site-packages\ibm_db_sa
>>> was pyodbc.py. Thinking that might be an older version, I renamed it,
>>> trying to force the import to use my installed version instead. It now
>>> says "cannot import name pyodbc". I thought Python searched the
>>> current directory, then the site-packages one, for modules? If so, and
>>> if I can import pyodbc with no errors in the shell, why would
>>> ibm_db_sa fail to import? This may be the problem--it was using an
>>> older version of pyodbc and can't find the newer one for some reason.
>>> Any ideas, or am I completely off track with this?
>>>
>>> On 2/15/16, Alex Hall <ah...@autodist.com> wrote:
>>>> Thanks guys. I've checked the version I'm using, and it reports that
>>>> ibm_db_sa.__version__ is '0.3.2'. I have both ibm_db_sa and ibm_db
>>>> installed. Should I remove ibm_db and rely only on ibm_db_sa instead?
>>>> Is the former package causing a conflict somehow?
>>>>
>>>> On 2/15/16, Jaimy Azle <jaimy.a...@gmail.com> wrote:
>>>>> Try to use ibm_db_sa 0.3.2 instead, apparently you are using the
>>>>> previous
>>>>> version. dbms_ver is a feature specific of native ibm_db version of
>>>>> which
>>>>> not available in pyodbc.
>>>>>
>>>>> https://pypi.python.org/pypi/ibm_db_sa/0.3.2
>>>>>
>>>>>
>>>>> Salam,
>>>>>
>>>>> -Jaimy.
>>>>>
>>>>>
>>>>> On Feb 12, 2016 22:05, "Alex Hall" <ah...@autodist.com> wrote:
>>>>>
>>>>>> Hello list,
>>>>>> I've configured a DSN to a test version of my work's AS400 and I seem
>>>>>> to be able to connect just fine (Yes!) I'm now running into a problem
>>>>>> when I try to ask for a list of all tables. The line is:
>>>>>>
>>>>>> dbInspector = inspect(dbEngine)
>>>>>>
>>>>>> The traceback is very long, and I can paste it if you want, but it
>>>>>> ends with this:
>>>>>>
>>>>>> AttributeError: 'pyodbc.Connection' object has no attribute
>>>>>> 'dbms_ver'
>>>>>>
>>>>>> I'm unable to find anything about this online, so thought I'd check
>>>>>> with this list. Here's my connection:
>>>>>>
>>>>>> dbEngine = create_engine("ibm_db_sa+pyodbc://user:pwd@myDSN")
>>>>>>
>>>>>> If anyone knows what is causing this, I'd appreciate your thoughts.
>>>>>> I've installed pyodbc, ibm_db, and ibm_db_sa through pip, so I should
>>>>>> have all the latest versions of everything. I'm on Windows 7x64,
>>>>>> Python 2.7 (latest).
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> "sqlalchemy" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send
>>>>>> an
>>>>>> email to sqlalchemy+unsubscr...@googlegroups.com.
>>>>>> To post to this group, send email to sqlalchemy@googlegroups.com.
>>>>>> Visit this group at https://groups.google.com/group/sqlalchemy.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups
>>>>> "sqlalchemy" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an
>>>>> email to sqlalchemy+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to sqlalchemy@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/sqlalchemy.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sqlalchemy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> Visit this group at https://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to