[Serusers] Python Script with IVR

Martin Solli martin at strangedays.no
Mon May 24 16:39:10 CEST 2004


Shirley Toh:
> I am trying to read the import MySQLdb into the ivr.py script to
> read values
> from the sql database but I got error in missing modules. Please
> help. What
> should I do to be able to read values from the database in the
> ivr.py script
> for development purpose. Please help......Thanks in advance. 

What you need to do is to link the MySQLdb module into Sems when
you compile it. In plug-in/ivr/Makefile, change the module_ldflags
line to something like this:

module_ldflags = -L/usr/lib/python$(PYTHON_VERSION)/config \
        -lpython$(PYTHON_VERSION) -ldl -lpthread -lutil -lm \
        -Xlinker -export-dynamic \
        /usr/lib/python2.2/site-packages/_mysql.so \
        /usr/lib/python2.2/lib-dynload/time.so \
        /usr/lib/python2.2/lib-dynload/array.so

In short, you will need to link statically against any shared
libray module that you use in Python, ie. any module whose name
ends with '.so'.

This problem was recently discussed on the Sems list. I suggest
you have a look in the archives for more info on this.
<http://lists.iptel.org/cgi-bin/mailman/listinfo/sems>

-- 
.\\artin
Despite it's high cost, living remains popular.




More information about the sr-users mailing list