#60 import odbc; dbi.pyd not correctly in

open
nobody
None
5
2004-10-10
2004-10-10
kxroberto
No

using the odbc module (from win32all), dbi.pyd is
copied, but not in the library.zip : no dbi.pyo! thus
not fould.

Discussion

  • Thomas Heller

    Thomas Heller - 2004-11-18

    Logged In: YES
    user_id=11105

    Does it work when you write it in this way:

    import dbi
    import odbc

     
  • Leonhard Vogt

    Leonhard Vogt - 2008-12-19

    I have observed no problem with 0.6.5 but with 0.6.6 the problem occurs:

    >type test_odbc.py
    if __name__ == '__main__':
    import odbc

    >type setup.py
    import distutils.core
    import py2exe

    distutils.core.setup(
    console = ['test_odbc.py']
    )

    >dist\test_odbc.exe
    Traceback (most recent call last):
    File "test_odbc.py", line 2, in <module>
    import odbc
    File "odbc.pyc", line 12, in <module>
    File "odbc.pyc", line 10, in __load
    odbc: Cannot import dbi module

    I have tried to find the difference between 0.6.5 and 0.6.6 that causes the error and found
    that the import works if I replace the run.exe from 0.6.6 by the one of 0.6.5
    in the site-packages\py2exe directory.
    So I suppose the problem is not in the packageing itself but in the way modules are loaded
    in the resulting .exe file.

    It works with 0.6.6 if I import dbi before importing odbc as suggested in the comment.

    Leo

     

Log in to post a comment.