Problems running python from procmail

Piet van Oostrum piet at cs.uu.nl
Mon Aug 7 16:35:29 EDT 2000


>>>>> Alain TESIO <alain at onesite.org> (AT) writes:

AT> Hello,
AT> I can't run a python script from procmail.

AT> It is a server where I have no admin rights, I installed python locally and it's working
AT> fine from a shell.

AT> From procmail, I have to set LD_LIBRARY_PATH to the mysql library.

AT> When I'm piping a message to python from procmail, I get an error because it doesn't find
AT> the library libmysqlclient.so.6, so I have created this file :

AT> -rwxr-xr-x   1 onesite  onesiteg       81 Aug  6 10:56 /home/onesite/bin/mypython*
AT> ==============
AT> export LD_LIBRARY_PATH=/home/onesite/src/mysql_lib/
AT> /home/onesite/bin/python $*
AT> ==============

AT> My script is :
AT> ==============
AT> #!/home/onesite/bin/mypython

You cannot nest interpreters. In other words, after the #! there must be a
real executable, not another script. So I guess you should convert mypython
to a C program.
Maybe you can use env:

#!/usr/bin/env LD_LIBRARY_PATH=/home/onesite/src/mysql_lib/ python
as the first line of your python script.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list