473,668 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1824
On Jun 13, 7:03 am, arorap <aro...@gmail.c omwrote:
Hi,

I recently setupmod_python successfully and things work smooth.
However, I do not remember tellingmod_pyth onwhere to find Python
installation. There's not environment variable which gives that
information. As such how doesmod_pythonk now 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
2018
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 on comp.lang.python crediting all those who contributed. <p> Here's what I've done so far - and where I get stuck: <p> 1. I made default installations of the latest versions: - apache_2.0.47-win32-x86-no_ssl.msi - mod_python-3.0.3.win32.exe
2
2918
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 apache2-2.0.48-6mdk The rpm installed the python module as: /usr/lib/apache2-extramodules/mod_python.so And added a config file for apache:
3
2417
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 followed so far: 1. Installed mod_python from the rpm file. 2. Added LoadModule and AddModule directives to the httpd.conf file Now, I have a file called mod_test.py that contains the following code:
0
1069
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 box has multiple versions of python. when i'm 'root' the python version is 2.2.1 when i'm a user 'test', the version is 2.3.5
4
4667
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 message in windows event viewer : "The Apache service named Apache.exe reported the following error: before the error.log file could be opened.
1
1991
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 : Python 2.4.3,
113
5255
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 the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. The built-in SSL support is weak. Even basic sockets don't quite work right; the socket module...
2
1135
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 use that version now? any help would be great - thanks!
2
2045
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 index.py: from mod_python import apache from storylab import * .... and in the directory where index.py resides (/htdocs/python/), I have a directory called "storylab". Inside that directory is __init__.py. When I try to execute...
0
8374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.