•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,127 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 703 | Replies: 3
![]() |
•
•
Join Date: May 2006
Location: New Jersey
Posts: 1,421
Reputation:
Rep Power: 5
Solved Threads: 33
I use WAMP to develop my PHP/MySQL applications locally before moving them to a production server. I want to start teaching myself Python and wish to add Python to my installation. I have downloaded and installed Python 2.5 and also installed mod_python. Unfortunately getting Apache to recognize that Python is installed and run Python web pages isn't working. I either get a Python error or the contents of the Python file display on the screen.
Has anyone had any luck getting Python to work with WAMP specifically? If not any experience getting it to work with Apache on Windows would be appreciated.
Here is the error message I get:
Here is the code in index.py
Has anyone had any luck getting Python to work with WAMP specifically? If not any experience getting it to work with Apache on Windows would be appreciated.
Here is the error message I get:
•
•
•
•
MOD_PYTHON ERROR
ProcessId: 800
Interpreter: 'localhost'
ServerName: 'localhost'
DocumentRoot: 'C:/wamp/www/'
URI: '/python/index.py'
Location: None
Directory: 'C:/wamp/www/'
Filename: 'C:/wamp/www/python/index.py'
PathInfo: None
Phase: 'PythonHandler'
Handler: 'index.py'
Traceback (most recent call last):
File "C:\wamp\bin\python\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "C:\wamp\bin\python\Lib\site-packages\mod_python\importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "C:\wamp\bin\python\Lib\site-packages\mod_python\importer.py", line 304, in import_module
return __import__(module_name, {}, {}, ['*'])
ImportError: No module named index.py
Here is the code in index.py
Python Syntax (Toggle Plain Text)
from mod_python import apache def handler(req): req.content_type = "text/plain" req.write("Hello World!") return apache.OK
Last edited by stymiee : May 12th, 2008 at 11:21 pm.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: May 2006
Location: New Jersey
Posts: 1,421
Reputation:
Rep Power: 5
Solved Threads: 33
Update: I changed PythonHandler to say PythonHandler mod_python.publisher in my http.conf file and that solved my other errors. But now I get a 404 error for index.py which is definitely in the right place.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: Jun 2008
Posts: 44
Reputation:
Rep Power: 1
Solved Threads: 0
hi..
i am also a php/mysql user, and i have till date used PHP only in this regard. Now, i want to learn and use Python/Perl with WAMP.
1. Is this possible?
2. If so, what additional softwares would i need to install to run Python/Perl (i already have WAMP server installed and working)
3. Where can i get these additional softwares from?
any help will be highly appreciated...
thx...
i am also a php/mysql user, and i have till date used PHP only in this regard. Now, i want to learn and use Python/Perl with WAMP.
1. Is this possible?
2. If so, what additional softwares would i need to install to run Python/Perl (i already have WAMP server installed and working)
3. Where can i get these additional softwares from?
any help will be highly appreciated...
thx...
Last edited by akshit : 26 Days Ago at 11:04 am.
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
•
•
hi..
i am also a php/mysql user, and i have till date used PHP only in this regard. Now, i want to learn and use Python/Perl with WAMP.
1. Is this possible?
2. If so, what additional softwares would i need to install to run Python/Perl (i already have WAMP server installed and working)
3. Where can i get these additional softwares from?
any help will be highly appreciated...
thx...
1. Yes it is. mod_python is required if you want to run python.
2. I recommend you to take a look at Django (http://www.djangoproject.com) and TurboGears (www.turbogears.org).
3. The links are above
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
- Previous Thread: Regarding split()
- Next Thread: Help With Python



Linear Mode