problem with mod_python

Discussion in 'Python' started by Pradnyesh Sawant, Feb 17, 2008.

  1. 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-----
    Pradnyesh Sawant, Feb 17, 2008
    #1
    1. Advertising

  2. 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.modpython.org/)

    --
    Arnaud
    Arnaud Delobelle, Feb 17, 2008
    #2
    1. Advertising

  3. On Feb 17, 3:29 pm, Pradnyesh Sawant <> 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
    Graham Dumpleton, Feb 17, 2008
    #3
  4. 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/python-list


    --
    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-----
    Pradnyesh Sawant, Feb 17, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Medland

    Mod_python xml parsing problem

    Mike Medland, Jul 1, 2003, in forum: Python
    Replies:
    0
    Views:
    367
    Mike Medland
    Jul 1, 2003
  2. Doug Farrell

    Problem with mod_python and 4Suite

    Doug Farrell, Aug 8, 2003, in forum: Python
    Replies:
    2
    Views:
    330
    Doug Farrell
    Aug 12, 2003
  3. Gandalf

    mod_python problem

    Gandalf, May 6, 2004, in forum: Python
    Replies:
    3
    Views:
    1,495
    Gandalf
    May 7, 2004
  4. ws Wang
    Replies:
    2
    Views:
    483
    ws Wang
    Nov 30, 2004
  5. blbmdsmith
    Replies:
    1
    Views:
    629
    Graham Dumpleton
    Dec 14, 2006
Loading...

Share This Page