2

After finishing install mod_python, I got 500 Internal Server Error. I looked up the log, it says: python_handler: Can't get/create interpreter.

Then I open a python terminal and to test if I can import mod_python. Then I got errors as follows:

>>> import mod_python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/mod_python/__init__.py", line 25, in <module>
    import version
  File "/usr/local/lib/python2.7/dist-packages/mod_python/version.py", line 3
    version = "fatal: Not a git repository (or any of the parent directories): .git
                                                                              ^
SyntaxError: EOL while scanning string literal

I installed mod_python with command --with-python=/usr/bin/python which version is 2.7.3.

Any ideas why this happens? Thanks ahead!

EDIT: I tried to reinstall mod_python with python2.6, I found I missed the SyntaxError posted during installation.

SyntaxError: ('EOL while scanning string literal', ('/usr/local/lib/python2.6/site-packages/mod_python/version.py', 3, 79, 'version = "fatal: Not a git repository (or any of the parent directories): .git\n'))

This error did appear during the installation.

2 Answers 2

5

I had the same problem using mod_python-3.5.0. The problem seems to be in the dist/version.sh file which runs git, but since the distribution doesn't have the .git repository structure, the error is generated.

I fixed version.sh by just replacing the offending line with an empty definition:

#GIT=`git describe --always`
GIT=
Sign up to request clarification or add additional context in comments.

Comments

1

or remove the line

GIT='git describe --always'

in /usr/local/src/mod_python-3.5.0/dist/version.sh

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.