0

I installed mod_python, I try to run python script like:

from mod_python import apache

It show me the error message:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    from mod_python import apache
  File "D:\Python27\lib\mod_python\apache.py", line 55, in <module>
    import _apache
ImportError: No module named _apache

I don't know why?

My enviroment: Windows XP, Python 2.7.2

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130

2 Answers2

0

Its probably that the script location is not added to your path.

try:

import sys
sys.path
sys.path.append('/path/to/the/mod_python.py')

If this doesn't work, it was probably not installed correctly.

If you want to add it to your system path permanently so you don't have to use the code above every time check out this SO question.

Community
  • 1
  • 1
agconti
  • 17,780
  • 15
  • 80
  • 114
0

If you don't get any help here, try the mod_python mailing list:

http://www.modpython.org/live/mod_python-2.7.8/doc-html/installation.html

7stud
  • 46,922
  • 14
  • 101
  • 127