ImportError:无法导入名称 ResponseError

ImportError: cannot import name ResponseError

提问人:Ishita 提问时间:3/11/2018 更新时间:3/11/2018 访问量:1236

问:

我正在尝试使用mod_python。 但是,当我尝试访问我的页面时,出现以下错误。

    Traceback (most recent call last):

  File "/usr/lib64/python2.6/site-packages/mod_python/importer.py", line 1540, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib64/python2.6/site-packages/mod_python/importer.py", line 1205, in _process_target
    module = import_module(module_name, path=path)

  File "/usr/lib64/python2.6/site-packages/mod_python/importer.py", line 299, in import_module
    log, import_path)

  File "/usr/lib64/python2.6/site-packages/mod_python/importer.py", line 683, in import_module
    execfile(file, module.__dict__)

  File "/var/www/pylons-data/prod/reports/scripts/access_reports.py", line 2, in <module>
    import requests

  File "/usr/lib/python2.6/site-packages/requests/__init__.py", line 60, in <module>
    from .api import request, get, head, post, patch, put, delete, options

  File "/usr/lib/python2.6/site-packages/requests/api.py", line 14, in <module>
    from . import sessions

  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 27, in <module>
    from .adapters import HTTPAdapter

  File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 29, in <module>
    from .packages.urllib3.exceptions import ResponseError

ImportError: cannot import name ResponseError

任何帮助都是值得赞赏的。不知道我该如何解决

apache mod-python urllib3

评论


答:

0赞 Wira Bhakti 3/11/2018 #1

也许确保您的模块在 sys.path 列表中

评论

0赞 Ishita 3/11/2018
有趣的是,我们有 3 台几乎相同的服务器,mod_python代码可以在除这台服务器之外的 2 台服务器中使用。我无法弄清楚这里有什么不同。此外,所有更改都是通过 ansible 进行的,因此它们必须在所有服务器上都相同