导入mod_python时出现错误

朱尼

完成安装mod_python后,出现500 Internal Server Error。我查看了日志,上面写着:python_handler:无法获取/创建解释器。

然后,我打开一个python终端并测试是否可以导入mod_python。然后我得到如下错误:

>>> 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

我使用--with-python = / usr / bin / python命令安装了mod_python版本为2.7.3。

任何想法为什么会发生这种情况?谢谢你!

编辑:我尝试用python2.6重新安装mod_python,我发现我错过了安装过程中发布的SyntaxError。

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'))

在安装过程中确实出现了此错误。

罗恩

我在使用mod_python-3.5.0时遇到了同样的问题。问题似乎出在运行git的dist / version.sh文件中,但是由于发行版不具有.git存储库结构,因此会生成错误。

我通过用一个空的定义替换有问题的行来修复version.sh:

#GIT=`git describe --always`
GIT=

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章