[egenix-users] Problem with Python mxODBC

Maneesh Singh maneeshsingh at yahoo.com
Tue Jan 4 01:10:23 CET 2005


Hi,
   I have successfully installed freetds & unixODBC
and I am able to connect to the remote MS SQL Server
2000 database through tsql & isql from my Fedora Core
2 machine. I need to connect to the MS SQl DB through
Python & hence went for mxODBC. I installed the RPM &
later also tried the source with the same negative
result:
Traceback (most recent call last):
  File "db3.py", line 4, in ?
    import mx.ODBC.unixODBC
  File
"/usr/lib/python2.3/site-packages/mx/ODBC/unixODBC/__init__.py",
line 8, in ?
    from mxODBC import *
ImportError: libiodbcinst.so.2: cannot open shared
object file: No such file or directory
------------------------------------------

The code (db3.py) under test is as follows:


#!/usr/bin/python2.3

import mx.ODBC.unixODBC

dsn="ps0196"

conn=mx.ODBC.unixODBC.Connect (dsn, "maneesh_singh",
"newuser")

print "Content-Type: text/plain"
print 

cursorhandle=conn.cursor()

print "MySQL Databse via mxODBC....\n"
cursorhandle.execute("select * from tb_mis_team")

for i in cursorhandle.fetchall():
    print i

print cursorhandle.fetchall()

for i in cursorhandle.fetchall():
    print i
------------------------------------------
[root at ps0778 unixODBC]# pwd
/usr/lib/python2.3/site-packages/mx/ODBC/unixODBC

[root at ps0778 unixODBC]# ldd ./mxODBC.so
        linux-gate.so.1 =>  (0x00399000)
        libodbc.so.1 => /usr/lib/libodbc.so.1
(0x00506000)
        libpthread.so.0 => /lib/tls/libpthread.so.0
(0x00111000)
        libc.so.6 => /lib/tls/libc.so.6 (0x006e9000)
        libiodbcinst.so.2 => not found
        libdl.so.2 => /lib/libdl.so.2 (0x00db8000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2
(0x0089d000)

------------------------------------------
 
  I had earlier tried to install iODBC without
success.  The library libiodbcinst.so.2 exists at
/usr/local/lib. I need to use unixODBC and not iODBC.

Why is it asking for iODBC libraries when unixODBC is
present? Was I supposed to use setup.in file the
source code folders to configure something? Please
help!

Thanks!


Maneesh.



		
__________________________________ 
Do you Yahoo!? 
Dress up your holiday email, Hollywood style. Learn more. 
http://celebrity.mail.yahoo.com



More information about the egenix-users mailing list