[egenix-users] Problem with Python mxODBC, undefined symbol:
SQLSetConfigMode
Maneesh Singh
maneeshsingh at yahoo.com
Thu Nov 11 08:01:27 CET 2004
Hi,
I tried the ldd ./mxODBC.so
It does not have a link for libiodbc.so.2
Which it should! The problem with RPM was that the
dependency on libiodbc.so.2. This actually existed on
the machine and I also gave this library path under
the LD_LIBRARY_PATH variable. Still it would say
dependency on libiodbc.so.2. Hence I went in for SRC
install which would give the
"PyUnicodeUCS2_AsEncodedString" error. Then I
installed it with rpm --rebuild SRC RPM. I have done
so many methods, I can't even remeber which the
current method under which it is running. Four hours
were spent installing iODBC and mxODBC from sources,
RPMs. I have followed all the procedures I could
possibly find in README files.
Anyways, how do I rectify the ldd ./mxODBC.so not
giving libiodbc.so.2.
Thanks!
Maneesh.
--- "M.-A. Lemburg" <mal at egenix.com> wrote:
> Maneesh Singh wrote:
> > Hi,
> >
> > I'm trying to connect to a Microsoft SQL Server
> 2000
> > database through a Fedora Core 2 machine, using
> python
> > 2.3.
> >
> > I have tried using the mxODBC package from eGenix.
> >
> > The code is as follows:
> >
> > --------------------------------
> > #!/usr/bin/python2.3
> >
> > import mx.ODBC.iODBC
> >
> > db =
> >
>
mx.ODBC.iODBC.DriverConnect('DSN=db_mis;UID=maneesh_singh;PWD=newuser')
> > c = db.cursor()
> > c.execute('select count(*) from tb_mis_team')
> > c.fetchone()
> >
> > c.tables(None,None,None,None)
> >
> > mx.ODBC.print_resultset(c)
> > c.close()
> > db.close()
> > --------------------------------
> >
> >
> > This is the output that I get:
> >
> > --------------------------------
> > [root at ps0778 cgi-bin]# python db5.py
> > Traceback (most recent call last):
> > File "db5.py", line 4, in ?
> > import mx.ODBC.iODBC
> > File
> >
>
"/usr/lib/python2.3/site-packages/mx/ODBC/iODBC/__init__.py",
> > line 8, in ?
> > from mxODBC import *
> > ImportError:
> >
>
/usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so:
> > undefined symbol: SQLSetConfigMode
> > [root at ps0778 cgi-bin]#
> > --------------------------------
> >
> >
> > Could anyone tell me what could be the problem
> here?
>
> SQLSetConfigMode is not used in mxODBC, so this
> unresolved
> symbol mut be coming from iODBC. Try ldd ./mxODBC.so
> and see whether it acutally picks up the right
> version
> of libiodbc (the one you compiled mxODBC against).
>
> > I have installed eGenix's mxODBC from source, and
> if
> > the installation is done through SRC RPM, then the
> > error that we get is
> >
> > ImportError:
> >
>
/usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so:
> > undefined symbol: PyUnicodeUCS2_AsEncodedString
>
> This is the standard UCS2 vs. UCS4 build problem:
>
> Python can be compiled to
> use UCS2 Unicode (2 bytes per Unicode code point) or
> UCS4
> (4 bytes). Many current Unix distributions choose
> UCS4
> as the default since that's also what the glibc
> chose
> as default.
>
> You have to build mxODBC using the build version
> that your
> Python installation uses.
>
> > It like I install through this method then one
> > problem, another method then another problem. I
> nee
> > the above problems solved together.
> >
> >
> > Thanks!
>
> --
> Marc-Andre Lemburg
> eGenix.com
>
> Professional Python Services directly from the
> Source (#1, Nov 11 2004)
> >>> Python/Zope Consulting and Support ...
> http://www.egenix.com/
> >>> mxODBC.Zope.Database.Adapter ...
> http://zope.egenix.com/
> >>> mxODBC, mxDateTime, mxTextTools ...
> http://python.egenix.com/
>
________________________________________________________________________
>
> ::: Try mxODBC.Zope.DA for
> Windows,Linux,Solaris,FreeBSD for free ! ::::
>
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
More information about the egenix-users
mailing list