1

I've already installed mod_python, but when i'm trying to use it:

eg.

>>>import mod_python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ImportError: No module named mod_python

-

[root@lab6 /]# yum install mod_python
Loaded plugins: rhnplugin, security
Setting up Install Process
Package mod_python-3.2.8-3.1.x86_64 already installed and latest version
Nothing to do

I can't import it even though i've already installed it in a Redhat server.

And it's suposed to be used to deploy Django in a Redhat server with this httpd.conf entry:

<VirtualHost mritest2.domain.ch:80>
        ServerName mritest2.domain.ch
        DocumentRoot /home/django_www/hardi

        <Location "/">
            SetHandler python-program
            PythonHandler django.core.handlers.modpython
            SetEnv DJANGO_SETTINGS_MODULE mri.settings
            PythonDebug On

            PythonPath "['/home/django_www', '/home/django_www/hardi'] + sys.path"
        </Location>

        <Location "/static/">
            SetHandler None
        </Location>
</VirtualHost>

1 Answer 1

4

mod_python is a HTTPd module, not a Python package; its virtual modules are only available to code it is running, not the REPL.

But in truth mod_python has been dead for a while now, and you should migrate to mod_wsgi ASAP.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks, I've another question regarding mod_wsgi: I'was trying to install it - "sudo ./configure --with-python=/opt/python2.5/bin/python" But i couldn't find this dir: "/opt/python2.5/bin/python" in my filesystem.. Is there any other way to install mod_wsgi?
just tried it, but it doesn't work: "No package mod_wsgi available. "
problem solved: i found the dir at: "/root/epd-5.1.0/bin/python", thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.