473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem with Python module

Hi,
I want to connect to a remote MS SQL Server 2000 database through
my Fedora Core 2 machine via Python scripts. I have successfully
installed freetds & unixODBC and can now connect to the desired DB
through tsql(freetds) & isql(unixODBC). I installed mxODBC (RPM &
source) to be able to connect to the DB via Python scripts without any
success.

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
----------------------------------------------

The output is as follows:
----------------------------------------------
[root@ps0778 cgi-bin]# python db3.py
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
----------------------------------------------

Additional info:
----------------------------------------------
[root@ps0778 unixODBC]# pwd
/usr/lib/python2.3/site-packages/mx/ODBC/unixODBC
[root@ps0778 unixODBC]# ldd ./mxODBC.so
linux-gate.so.1 => (0x0070b000)
libodbc.so.1 => /usr/lib/libodbc.so.1 (0x00b26000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x007ca000)
libc.so.6 => /lib/tls/libc.so.6 (0x00eaa000)
libiodbcinst.so.2 => not found
libdl.so.2 => /lib/libdl.so.2 (0x006b2000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0089d000)
-----------------------------------------------

I want to use unixODBC and not iODBC, why is mxODBC looking for
iODBC's libraray? I had earlier tried to install iODBC,
unsuccessfully, hence shifted over to unixODBC. The missing iODBC
library exist in /usr/local/lib folder. Do I need to link the iODBC
library to mxODBC during installation? How? Configure setup.in in the
source setup?
Thanks!

Maneesh.
Jul 18 '05 #1
0 2113

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
8
by: geert | last post by:
Hi all, I have a mac mini running maocosx 10.5 leopard I want to deploy a django project on. My backend is MySQL, and I have it running as a 64- bit app. Of course, apache2 is also running as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.