[Tutor] import MySQLdb problem

helena bhaska helena_b2001 at yahoo.com
Mon Dec 29 20:50:10 EST 2003


To all those linux newbies like me who get stuck with
problems like this, here is what solved my problem:
I added the path to MySQLdb to /etc/ld.so.conf.
That's it! :)
--- helena bhaska <helena_b2001 at yahoo.com> wrote:
> Hi,
> I realize that this has already been discussed, but
> I
> am unable to solve the following problem:
> I am trying to import MySQLdb in a script that is
> running on apache server.  
> The proposed solutions mentioned writing a wrapper
> shell script that would set LD_LIBRARY_PATH variable
> before executing python script.  However, my script
> is
> not executed from command prompt, it is called
> through
> urllib.urlopen() and I am not sure how to go to
> shell
> script from this.
> I have tried using SetEnv and PassEnv in httpd.conf
> in
> apache, but that did not fix the problem, the
> behavior
> was exactly the same as before.  (ImportError: No
> module named MySQLdb).
> I am probably misunderstanding how to use
> LS_LIBRARY_PATH, I assumed that I was supposed to
> give
> path to where MySQLdb is, so here is what I have
> done:
> 
> SetEnv LD_LIBRARY_PATH
> /usr/local/lib/python2.3/site-packages/
> PassEnv LD_LIBRARY_PATH
> 
> site-packages contain MySQLdb subdir.
> So is there a way to call a shell script though
> urllib.urlopen() or should httpd.conf be modified,
> and
> if so  what am I doing wrong?
> Thank you very much!
> -Helena
> 
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



More information about the Tutor mailing list