[egenix-users] Re: FW: Error Importing mx.ODBC.iODBC

M.-A. Lemburg mal at egenix.com
Thu Jan 8 19:47:36 CET 2004


Gary Ebersole wrote:
> Marc,
> 
> Thanks for the earlier advice. I ran the setup install as recommended
> below (base install worked fine) but gcc exited with an error that it
> could not find '-liodbc' (see output below). The iODBC libraries are
> installed in /usr/lib. Any suggestions?

The command line looks OK. Perhaps there are permission problems ?

You should have a file libiodbc.so in /usr/lib:

-rw-r--r--    1 root     root       141852 Mar 17  2003 /usr/lib/libiodbc.a
-rw-r--r--    1 root     root          712 Mar 17  2003 /usr/lib/libiodbc.la
lrwxrwxrwx    1 root     root           17 Aug  6 22:59 /usr/lib/libiodbc.so -> libiodbc.so.2.1.6
lrwxrwxrwx    1 root     root           17 Aug  6 22:58 /usr/lib/libiodbc.so.2 -> libiodbc.so.2.1.6
-rwxr-xr-x    1 root     root       126285 Mar 17  2003 /usr/lib/libiodbc.so.2.1.6

> Thanks again for your time and patience.
> 
> Gary 
> 
> P.S. I have sent this to the list to preserve your initial response.

I've checked the mailing list logs: they say you are not yet
subscribed and thus ignore the messages (because we so much
spam directed towards the list, we've disabled notices).

> -----------------------------------------------
> $python setup.py install
> running install
> running build
> running mx_autoconf
> macros to define: []
> macros to undefine: []
> updated build_ext with autoconf setup
> running build_ext
>  
> building extension "mx.ODBC.iODBC.mxODBC" (required)
> building 'mx.ODBC.iODBC.mxODBC' extension
> creating build/temp.linux-i686-2.2
> creating build/temp.linux-i686-2.2/mx
> creating build/temp.linux-i686-2.2/mx/ODBC
> creating build/temp.linux-i686-2.2/mx/ODBC/iODBC
> creating build/temp.linux-i686-2.2/mx/ODBC/iODBC/mxODBC
> gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC
> -fPIC -DiODBC -Imx/ODBC/iODBC -I/usr/local/iODBC/include
> -I/usr/include/python2.2 -I/usr/local/include -I/usr/include -c
> mx/ODBC/iODBC/mxODBC.c -o
> build/temp.linux-i686-2.2/mx/ODBC/iODBC/mxODBC/mxODBC.o
> gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC
> -fPIC -DiODBC -Imx/ODBC/iODBC -I/usr/local/iODBC/include
> -I/usr/include/python2.2 -I/usr/local/include -I/usr/include -c
> mx/ODBC/iODBC/mxSQLCodes.c -o
> build/temp.linux-i686-2.2/mx/ODBC/iODBC/mxODBC/mxSQLCodes.o
> gcc -shared build/temp.linux-i686-2.2/mx/ODBC/iODBC/mxODBC/mxODBC.o
> build/temp.linux-i686-2.2/mx/ODBC/iODBC/mxODBC/mxSQLCodes.o
> -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o
> build/lib.linux-i686-2.2/mx/ODBC/iODBC/mxODBC.so
> /usr/bin/ld: cannot find -liodbc
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
> 
> 
> -----Original Message-----
> From: M.-A. Lemburg [mailto:mal at egenix.com] 
> Sent: Thursday, January 08, 2004 8:43 AM
> To: garyeb at pacbell.net
> Subject: Re: FW: Error Importing mx.ODBC.iODBC
> 
> 
> Gary Ebersole wrote:
> 
>>Marc,
>>
>>My apologies for forwarding this to you directly but I had not heard 
>>back with a confirmation email on joining the egenix-users. I sent 
>>this message to the list but I'm not certain if it was posted.
> 
> 
> It has not made it to the list; not sure why -- there's no notice of it
> being held by Mailman.
> 
> 
>>Thanks for any help you can provide.
>>
>>Gary
>>
>>-----Original Message-----
>>From: Gary Ebersole [mailto:garyeb at pacbell.net]
>>Sent: Thursday, January 08, 2004 8:07 AM
>>To: egenix-users at lists.egenix.com
>>Subject: Error Importing mx.ODBC.iODBC
>>
>>
>>I'm a Python newbie struggling with trying to install the mxODBC 
>>package from Egenix in RH Linux 9 (kernel (2.4.20). Per the dialogue 
>>below, I used the mxBase and commercial binary RPMs for the default 
>>Python 2.2 installed by RH into the /usr directory. I also built a 2.3
> 
> 
>>version of Python, installed it in /usr/local and then installed the 
>>appropriate Egenix packages. The iODBC package had been successfully 
>>installed earlier (the IODBC driver manager admin tool was able to 
>>locate and install an ODBC driver). However, I was forced to use 
>>'--nodeps' to override the following error message even though these 
>>libraries were in
>>/usr/lib:
>>
>>error: Failed dependencies:
>>        libiodbc.so.2 is needed by egenix-mx-commercial-2.0.6-py2.2_1
>>        libodbc.so.1 is needed by egenix-mx-commercial-2.0.6-py2.2_1
>>
>>Running both Python 2.2 and 2.3 generated the following error when 
>>trying to import mx.ODBC.iODBC:
>>
>>Traceback (most recent call last):
>>  File "<stdin>", line 1, in ?
>>  File "/usr/lib/python2.2/site-packages/mx/ODBC/iODBC/__init__.py",
>>line 8, in ?
>>    from mxODBC import *
>>ImportError: /usr/lib/python2.2/site-packages/mx/ODBC/iODBC/mxODBC.so:
>>undefined symbol: PyUnicodeUCS2_AsEncodedString
> 
> 
> The problem is that Redhat builds Python using UCS4 Unicode, while we
> ship RPMs that use Python's default setting UCS2.
> 
> You will have to build both packages from source:
> 
> 1. untar the source archive
> 2. cd to the package dir
> 3. python2.2 setup.py install
> 
> That's it.
> 
> 
>>Any ideas? It's probably painfully obvious to experienced Python and 
>>Linux users but I'm at a loss. I'd hate to revert to learning Perl 
>>since Python is ideal for someone with my requirements.
> 
> 
> 
> 
>>Thanks!
>>
>>Gary
>>
>>USING PYTHON 2.2 INSTALLED IN /USR BY REDHAT
>>--------------------------------------------
>>Egenix Packages installed:
>>  egenix-mx-base-2.0.5-py2.2_1
>>  egenix-mx-commercial-2.0.6-py2.2_1
>>
>>$ /usr/bin/python
>>Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
>>[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
>>Type "help", "copyright", "credits" or "license" for more information.
>>
>>
>>>>>import sys
>>>>>sys.path
>>
>>['', '/usr/lib/python2.2', '/usr/lib/python2.2/plat-linux2', 
>>'/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages',
>>'/usr/lib/python2.2/site-packages/gtk-2.0']
>>
>>
>>>>>import mx
>>>>>import mx.DateTime
>>>>>import mx.ODBC
>>>>>import mx.ODBC.iODBC
>>
>>Traceback (most recent call last):
>>  File "<stdin>", line 1, in ?
>>  File "/usr/lib/python2.2/site-packages/mx/ODBC/iODBC/__init__.py",
>>line 8, in ?
>>    from mxODBC import *
>>ImportError: /usr/lib/python2.2/site-packages/mx/ODBC/iODBC/mxODBC.so:
>>undefined symbol: PyUnicodeUCS2_AsEncodedString
>>
>>
>>USING PYTHON 2.3 INSTALLED IN /USR/LOCAL
>>----------------------------------------
>>Egenix packages installed:
>>  egenix-mx-base-2.0.5-py2.3_1
>>  egenix-mx-commercial-2.0.6-py2.3_1
>>
>>$ /usr/local/bin/python
>>Python 2.3.3 (#1, Jan  7 2004, 14:09:01)
>>[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
>>Type "help", "copyright", "credits" or "license" for more information.
>>
>>
>>>>>import sys
>>>>>sys.path
>>
>>['', '/usr/local/lib/python23.zip', '/usr/local/lib/python2.3', 
>>'/usr/local/lib/python2.3/plat-linux2',
>>'/usr/local/lib/python2.3/lib-tk',
>>'/usr/local/lib/python2.3/lib-dynload',
>>'/usr/local/lib/python2.3/site-packages']
>>
>>
>>>>>import mx
>>>>>import mx.DateTime
>>>>>import mx.ODBC
>>>>>import mx.ODBC.iODBC
>>
>>Traceback (most recent call last):
>>  File "<stdin>", line 1, in ?
>>  File "/usr/lib/python2.3/site-packages/mx/ODBC/iODBC/__init__.py",
>>line 8, in ?
>>ImportError:
>>/usr/local/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so:
>>undefined symbol: PyUnicodeUCS2_AsEncodedString
>>
> 
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 06 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 ! ::::


More information about the egenix-users mailing list