problem with mod_python

P

Pradnyesh Sawant

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHt7gbL6rhPByZNPcRAlkQAKCQ4gb6Nth4DbaRFLpdySCfLFRUtgCeMpr0
icx5lyIChD6maTLZyYg7w3g=
=nrpp
-----END PGP SIGNATURE-----
 
A

Arnaud Delobelle

Pradnyesh said:
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.modpython.org/)
 
G

Graham Dumpleton

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
 
P

Pradnyesh Sawant

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!

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHuBp2L6rhPByZNPcRAiGZAJ9HezI6YmtU0ndhx2FGq5TIOnRymQCdFX4d
rU5iHqcqMsJJO2CQgKy820c=
=ovMb
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top