[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

problem with mod_python

Pradnyesh Sawant

2/17/2008 4:29:00 AM

Hello,
I have a small program which does 'import hashlib'. This program runs fine
with python2.5. But when I try running the same program through mod_python,
I get the error: 'ImportError: No module named hashlib' in the apache2
error.log

Searching online suggested me to include md5.so or md5module.so in apache2.
but I don't see that in a package for debian lenny (the system I'm using).

So, my Q is, is it possible to make mod_python use the same PYTHONPATH as
the python2.5 interpreter? if so, how?

any other suggestions to solve the above problem are welcome too.
thanks!
--
warm regards,
Pradnyesh Sawant
--
We are not just our behaviour. We are the person managing our behaviour.
--The One Minute Manager
3 Answers

Arnaud Delobelle

2/17/2008 7:30:00 AM

0



Pradnyesh Sawant wrote:
> Hello,

Hi

[...]
> So, my Q is, is it possible to make mod_python use the same PYTHONPATH as
> the python2.5 interpreter? if so, how?

You can use the PythonPath directive to set the PYTHONPATH to whatever
you want

> any other suggestions to solve the above problem are welcome too.
> thanks!

Have you tried the mod_python mailing list? (see http://www.modp...)

--
Arnaud

Graham.Dumpleton

2/17/2008 10:08:00 AM

0

On Feb 17, 3:29 pm, Pradnyesh Sawant <spra...@gmail.com> wrote:
> Hello,
> I have a small program which does 'import hashlib'. This program runs fine
> with python2.5. But when I try running the same program through mod_python,
> I get the error: 'ImportError: No module named hashlib' in the apache2
> error.log
>
> Searching online suggested me to include md5.so or md5module.so in apache2.
> but I don't see that in a package for debian lenny (the system I'm using).
>
> So, my Q is, is it possible to make mod_python use the same PYTHONPATH as
> the python2.5 interpreter? if so, how?
>
> any other suggestions to solve the above problem are welcome too.
> thanks!

Your mod_python isn't compiled against Python 2.5 but is using an
older version. You will need to rebuild mod_python to use Python 2.5
instead. You cannot just point mod_python at the Python 2.5 module
directories as they are incompatible.

Graham

Pradnyesh Sawant

2/17/2008 11:29:00 AM

0

On 02:07, 17Feb2008, Graham Dumpleton wrote:
> On Feb 17, 3:29 pm, Pradnyesh Sawant wrote:
> > Hello,
>
> Your mod_python isn't compiled against Python 2.5 but is using an
> older version. You will need to rebuild mod_python to use Python 2.5
> instead. You cannot just point mod_python at the Python 2.5 module
> directories as they are incompatible.

Thanks a lot! You were correct in pointing out the problem. I've found out
that hashlib is present in python2.5, and not in python2.4. I've decided to
go with python2.4, for the present, and use 'md5' instead of 'hashlib.md5'.
thanks again!

>
> Graham
>
> --
> http://mail.python.org/mailman/listinfo/p...

--
warm regards,
Pradnyesh Sawant
--
We are not just our behaviour. We are the person managing our behaviour.
--The One Minute Manager