problem with mod_python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pradnyesh Sawant

    #1

    problem with mod_python

    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)

    iD8DBQFHt7gbL6r hPByZNPcRAlkQAK CQ4gb6Nth4DbaRF LpdySCfLFRUtgCe Mpr0
    icx5lyIChD6maTL ZyYg7w3g=
    =nrpp
    -----END PGP SIGNATURE-----

  • Arnaud Delobelle

    #2
    Re: problem with mod_python



    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

    Comment

    • Graham Dumpleton

      #3
      Re: problem with mod_python

      On Feb 17, 3:29 pm, Pradnyesh Sawant <spra...@gmail. comwrote:
      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

      Comment

      • Pradnyesh Sawant

        #4
        Re: problem with mod_python

        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!
        --
        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)

        iD8DBQFHuBp2L6r hPByZNPcRAiGZAJ 9HezI6YmtU0ndhx 2FGq5TIOnRymQCd FX4d
        rU5iHqcqMsJJO2C QgKy820c=
        =ovMb
        -----END PGP SIGNATURE-----

        Comment

        Working...