致命的:安装mod_python时不是git存储库

Jun*_*yee 1 git mod-python

我正在尝试安装mod_python但是我收到了一个错误:

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

这是mod_python中使用的version.sh文件.

#!/bin/sh

MPV_PATH="`dirname $0`/../src/include/mp_version.h"

MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH`
MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH`
PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH`
GIT=`git describe --always`

echo $MAJ.$MIN.$PCH-$GIT
Run Code Online (Sandbox Code Playgroud)

我手动运行然后我得到:

fatal: Not a git repository (or any of the parent directories): .git
3.4.1-
Run Code Online (Sandbox Code Playgroud)

这是什么意思?请帮助!!

谢谢!

Rob*_*een 7

version.sh文件假定您从git安装.这似乎是一个错误.

要修复它,您可以删除该行

GIT=`git describe --always`
Run Code Online (Sandbox Code Playgroud)

并将下一行更改为

echo $MAJ.$MIN.$PCH
Run Code Online (Sandbox Code Playgroud)