472,965 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 software developers and data experts.

How does mod_python know where's Python installed ?

Hi,

I recently setup mod_python successfully and things work smooth.
However, I do not remember telling mod_python where to find Python
installation. There's not environment variable which gives that
information. As such how does mod_python know where to find Python ?
When I print sys.path in my scripts it contains my python installation
folder. I'm wondering how does Apache/mod_python get this
information ?

I'm running Apache 2.2 on windows.
-Puneet.

Jun 12 '07 #1
1 1782
On Jun 13, 7:03 am, arorap <aro...@gmail.comwrote:
Hi,

I recently setupmod_pythonsuccessfully and things work smooth.
However, I do not remember tellingmod_pythonwhere to find Python
installation. There's not environment variable which gives that
information. As such how doesmod_pythonknow where to find Python ?
When I print sys.path in my scripts it contains my python installation
folder. I'm wondering how does Apache/mod_pythonget this
information ?

I'm running Apache 2.2 on windows.
Rather than duplicate here, for a long explanation see the comments in
the file:

Modules/getpath.c

in the Python source code.

In short though, it searches for 'python' executable on PATH and from
that tries to determine where the corresponding 'lib' directory is for
the version of Python that mod_python is linked against.

Because it looks in PATH, this will not always work when people have
multiple versions of Python installed on their system with different
base directories. See:

https://issues.apache.org/jira/browse/MODPYTHON-225

for further details in respect of that problem.

Graham
Jun 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rolfe | last post by:
Has anyone had success getting mod_python to run on Apache on Win2K? I'm writing up instructions on how to do this and need your help. When completed, the instructions at the mod_python website and...
2
by: digidalmation | last post by:
Hello all. I've been trying to get my linux server to run mod_python. It's a Mandrake 10 linux box, and apache/mod_python are installed from rpms. apache2-mod_python-2.0.48_3.1.3-1mdk...
3
by: Anthony Papillion II | last post by:
Hello Everyone, I have downloaded and installed mod_python and it doesn't seem to be working. I am hoping someone can give me some pointers as to what I am doing wrong. Here are the steps I've...
0
by: bruce | last post by:
hi... i have a linux redhat8 server. i'm trying to get python andmod_python to play nicely, meaning that i have the right mod_python for the python that i've installed. it appears that the...
4
by: Gaurav Agarwal | last post by:
Hi, Am using WAMP5 and python 2.4.3. I tried to install mod_python 3.2.5 for python2.4. When i tried starting wamp, Firstly there was no error message in the apache error log. I saw error...
1
by: boney | last post by:
hello All, I am totally unknown to python language.. i need to install mod_python to embed python interpreter with the Apache server, in order to use Trac with Apache Web Server i am using...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
2
by: leland | last post by:
i've upgraded my RHEL3 box to run python 2.3. problem is, mod_python still points to the old python 2.2. is there any way to tell mod_python that i've got a new version of python installed, and to...
2
by: Aaron Scott | last post by:
I've installed mod_python, and everything seems to be working, but it fails when I try to import another file into the file that's actually producing the output. I have these lines at the top of...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.