我在带有Plesk的Centos 7服务器上运行Python 2.7(Apache,MySQL来管理它。我已经安装了httplib2 - 与其他软件包一起 - 通过pip。
问题是httplib2软件包偶尔会导致http 500错误。下面的日志是从服务器错误日志中随机选择的。
我试图有意识地复制错误,但我似乎无法在它发生时找到一个模式。它发生 - 大致 - 每隔一秒或第三次请求。
请注意,已安装的其他软件包不会出现http 500错误。
[Mon May 29 14:44:36.816911 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: Traceback (most recent call last):
[Mon May 29 14:44:36.816948 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: File "/usr/lib64/python2.7/site-packages/mod_python/apache.py", line 398, in HandlerDispatch\n result = obj(req)
[Mon May 29 14:44:36.816952 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: File "/usr/lib64/python2.7/site-packages/mod_python/cgihandler.py", line 96, in handler\n imp.load_module(module_name, fd, path, desc)
[Mon May 29 14:44:36.816955 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: File "/var/www/vhosts/[[MASKED]/httpdocs/scrape.py", line 8, in <module>\n import httplib2
[Mon May 29 14:44:36.816958 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: File "/usr/lib/python2.7/site-packages/httplib2/__init__.py", line 31, in <module>\n import email.Utils
[Mon May 29 14:44:36.816961 2017] [:error] [pid 29346:tid 140064881321728] [client [[MASKED]]] PythonHandler mod_python.cgihandler: ImportError: No module named Utils
Python脚本(仅此而已):
import httplib2