[Spambayes] install error -- python or spambayes?

Peter Barker peterb at zeta.org.au
Thu Aug 11 06:07:32 CEST 2005


I had this same problem, which I fixed by manually copying the spambayes
files and setting PYTHONPATH (The file you need is in python-devel, but I
didn't find this until later)

The following is what I did to use procmail:

* Copy the scripts and spambayes directories to a directory of your
choice (the following assumes this is $HOME/spambayes - this means the
application python files such as Options.py are in
$HOME/spambayes/spambayes)

* Add a line to $HOME/.bash_profile:
export PYTHONPATH=$PYTHONPATH:$HOME/spambayes

* Create $HOME/.spambayesrc with any required options, eg
[Storage]
persistent_use_database = True
persistent_storage_file = ~/spambayes/hammiedb

* Add lines like the following to $HOME.procmailrc
PATH=$HOME/bin:/bin:/usr/bin
MAILDIR=$HOME/.mail_folders
LOGFILE=$HOME/procmail.log
PYTHONPATH=$HOME/spambayes

:0 fw:hamlock
| $HOME/spambayes/scripts/sb_filter.py

:0
* ^X-Spambayes-Classification: spam
        $HOME/.mail_folders/spam

Note the definition of PYTHONPATH, and change the last line to suit your
mail program's folders location


* (Optional) I create two mail folders for mail which spambayes classifies
incorrectly. I use notham is for mail spambayes classes as ham which is
actually spam, and notspam is for mail incorrectly classified as spam.
Create a file $HOME/spambayes/anacrontab:
HOME=/home/peter
# Run every day, delay 10 minutes
1       10      spambayes /bin/env PYTHONPATH=$HOME/spambayes \
$HOME/spambayes/scripts/sb_mboxtrain.py -q -s $HOME/.mail_folders/notham \
-g $HOME/.mail_folders/notspam

* Add a line to .bash_profile:
/usr/sbin/anacron -t $HOME/spambayes/anacrontab

I hope this is of help

Peter Barker

>> I'm trying to install spambayes 1.0.4 in a *nix account, and there
>> seems to be a reasonable installation of python 2.3 on the machine.
>> Nonetheless, after unzipping and de-tarring the source code, I get the
>> following error:
>>
>>     % python setup.py install
>>     running install
>>     error: invalid Python installation: unable to open
>> /usr/lib/python2.3/config/Makefile (No such file or directory)

>(You can use SpamBayes without running setup.py, of course - just
>manually
>put the spambayes package directory on the PYTHONPATH, and run the
>scripts
>from wherever you like)."
>
>HOW?   "Can I just copy the required files manually? If so, what files
>(or
>directories) are needed to use spambayes with procmail (Kmail)?"
>I don't know how to set or find the 'PYTHONPATH' to install spambayes
>manually- if someone does, would you please explain it?


More information about the Spambayes mailing list