[mod_python] "could not import mod_python.apache

Tim Bellefy tbellefy at yahoo.com
Tue Sep 6 19:50:50 EDT 2005


Thanks for replying.
 
I added an alias in:   /root/.cshrc
alias python /usr/local/bin/python2.4
 
This tells every user to use python2.4 instead of old version
Just to be safe, I added the same alias to the user apache is using running under.
 
I tried calling my test.py from the command line again and it still fails.
 


Joshua Kifer <joshua at codeputty.com> wrote:
Apache is running a different install of python than the one you 
compiled against.

Make sure apache is running the python at: (that is, make sure it's 
first in the path of the user running apache):
/usr/local/bin/python2.4

(that is, make sure it's first in the path of the user that is 
running apache)


On Sep 6, 2005, at 12:24 PM, Tim Bellefy wrote:

> Hi All,
>
> I just installed mod_python so please bear with me...
>
> Steps I've done:
> OS: FreeBSD 4.7
> Installed Python 2.4.1
> Installed Apache 2.0.54
> Installed mod_python 3.1.4
>
> MOD PYTHON CONFIG:
> ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/ 
> usr/local/bin/python2.4
> make
> make install
>
> Everything installed fine.
>
> However, When I try the simple example found on modpyhon.org, I get 
> an error.
> from mod_python import apache
>
> def handler(req):
> req.write("Hello World!")
> return apache.OK
> APACHE http.conf
> 
> Options ExecCGI
> AllowOverride All
> AddHandler mod_python .py
> PythonHandler mptest
> PythonDebug On
> 
>
>
> APACHE ERROR:
> [Tue Sep 06 19:09:39 2005] [error] make_obcallback: could not 
> import mod_python.apache.
>
> WHEN RAN FROM COMMAND LINE:
>
> Traceback (most recent call last):
> File "test.py", line 2, in ?
> from mod_python import apache
> File "/usr/local/lib/python2.4/site-packages/mod_python/ 
> apache.py", line 28, in ?
> import _apache
> ImportError: No module named _apache
>
> Any Help????
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050906/9d8673df/attachment.html


More information about the Mod_python mailing list