[Mailman-Users] Mandrake 9.1 / ImportError: No module namedgetopt

Oliver.Egginger at dvz.fh-giessen.de Oliver.Egginger at dvz.fh-giessen.de
Tue May 13 13:46:23 CEST 2003

Richard Barrett <r.barrett at openinfo.co.uk> wrote: 
> > 
> >It seems that it is caused by the line 255 from mailmanctl: 
> > 
> >os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s') 
> Just a thought, but what is the value of the variable PYTHON in  
> $prefix/Mailman/Defaults.py and is this the same as the results of  
> executing "which python" from the command line? 
Default.py keeps:  
PYTHON          = '/usr/bin/python' 
and there are no overrides in mm.cfg. 
The command 'ls -l /usr/bin/python' shows me: 
-rwxr-xr-x    1 root     root         3712 Feb  5 10:41 /usr/bin/python* 
Also if there where a wrong path it should break with a command 
or file not found error, I think. 
For example: 
I write a little test script called test.py here it is 
-------------------------------------> SNIP 
#! /usr/bin/python 
import getopt 
print "Hallo\n"; 
print (getopt.error); 
print "\n"; 
If I start it from commandline it works faultless but if I call it 
from within the mailmanctl script changing the lines 254 and 255 to  
the following:  
exe = os.path.join(mm_cfg.BIN_DIR, 'test.py') 
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s') 
It produces the error messages: 
'import site' failed; use -v for traceback 
Traceback (most recent call last): 
  File "/home/mailman/bin/test.py", line 3, in ? 
    import getopt 
ImportError: No module named getopt 
Could not find platform independent libraries <prefix> 
Could not find platform dependent libraries <exec_prefix> 
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] 
'import site' failed; use -v for traceback 
It's the same failure I get from the qrunner script,  
which gets normally called at this point from mailmanctl. 
> If they are not the same then this might hint at the cause of your problem.  
> Did you add a --with-python option when you ran ./configure? If so with  
> what value? 
No. I don't exspect the problem there. 
The python interpreter gets called. 
I set  
PYTHON          = '/usr/bin/python' 
PREFIX          = '/home/mailman' 
EXEC_PREFIX     = '/usr/lib/python2.2' 
VAR_PREFIX      = '/home/mailman' 
Also I did many tests with  
EXEC_PREFIX     = '/home/mailman' 
No difference. 
- oliver 

More information about the Mailman-Users mailing list