[mod_python] Re: python/linux guru needed.. now!!!!

Graham Dumpleton grahamd at dscpl.com.au
Sat Mar 5 19:43:14 EST 2005


On 06/03/2005, at 9:10 AM, bruce wrote:

> graham...
>
> i did post this issue/question to the modpython group... although i 
> haven't
> posted there for a guru...

And on the mod_python mailing list you were asked some questions and
given some things to try. You didn't however give an answer to the
questions. We can't read minds. :-)

> but in answer to the rest of your questions....
>
> here's what i'm doing...
>
> python
> pyhton 2.3.3 ......
> type help...
>>>> import mod_python.psp
>   .
>   .
>   .
> ImportError: No module named mod_python

Getting this error in itself is strange, as trying to import a submodule
of a module that does not exist, would usually yield:

   ImportError: No module named mod_python.psp

if the parent module does not exist.

Either way, it simply doesn't look like mod_python is installed for that
version of Python. Does saying:

   import mod_python

fail as well. What error does it give in that situation?

You can verify manually whether it has been installed by finding the 
"site-packages"
directory for the Python installation and looking in there for a 
mod_python
directory.

Note that there are two parts to the installation of mod_python, there 
is the
Apache handler .so which gets installed in Apache modules directory and 
the
Python code modules which get installed in "site-packages". So far it 
seems
it is the latter that does not exist.

Anyway, if you don't know where to look for the "site-packages" 
directory, run
in Python:

   import sys
   print sys.prefix

This should tell you where Python stuff is being installed. For Python 
2.3, the
site-packages directory would be in a subdirectory of that directory 
called:

   lib/python2.3/site-packages

Thus change to directory specified by sys.prefix and then run:

   ls lib/python2.3/site-packages/mod_python

Does that say the directory doesn't exist? If it doesn't exist, then 
your installation
isn't complete. If it does exist, what is in that directory?

I also ask again the same question as posed in the original mailing 
list response to
you, do you possibly have more than one version of Python installed on 
your system?

> i'm doing the above from the linux command line
>
>
> i have
> RH8.0
> python-2.3.3-6
> mod_python-3.1.3-5
> apache/2.0.50 (built from source)
>
>
> so, any ideas!!!
>
> thanks...
>
> bruce
>
>
> -----Original Message-----
> From: python-list-bounces+bedouglas=earthlink.net at python.org
> [mailto:python-list-bounces+bedouglas=earthlink.net at python.org]On 
> Behalf
> Of grahamd at dscpl.com.au
> Sent: Saturday, March 05, 2005 1:56 PM
> To: python-list at python.org
> Subject: Re: python/linux guru needed.. now!!!!
>
>
>
> bruce wrote:
>> hi...
>>
>> i have a situation with a linux rh8 server. i can't seem to get
>> python/mod_python/apache working as one...
>>
>> i can't seem to import mod_python from the python interpreter to
> work, and
>> i'm not sure as to why. i'm fairly convinced that it's a conflict
> issue of
>> some type, but i'm not sure as to how to resolve it...
>>
>> if you are a guru with python/mod_python/linux then i'd like to talk
> with
>> you...
>>
>> searching through google/mailing lists/etc... is getting me nowhere!!
>
> You will do better if you present your problem in the mod_python
> mailing
> list. Go to http://www.modpython.org to get the mailing list details,
> get
> yourself on the list and then post the following information as a
> start.
>
> Which version of mod_python you are using.
>
> Whether you are using the global configuration file or a .htaccess
> file.
>
> The snippet of the Apache configuration you are using to configure
> mod_python and enable its use in the directory you are working in.
>
> Details of any error responses which are being displayed by your web
> browser.
>
> Details of messages, be they notices or error messages, which occur in
> the Apache error log file corresponding to any request you are making
> which is not working.
>
> The full contents of the Python code file for the content handler you
> are
> trying to use.
>
> --
> http://mail.python.org/mailman/listinfo/python-list



More information about the Mod_python mailing list