python & suds “ImportError: cannot import name getLogger”

你离开我真会死。 提交于 2019-12-08 06:45:51

问题


I'm using Ubuntu 11.04 (natty). I have been using Suds to consume a SOAP web service. Everything was working fine... until it wasn't. I can no longer import Suds. I've uninstalled and re-installed Suds from the Ubuntu repositories but still get the same import error (see IDLE traceback below). I'm using Python 2.7.1 and Suds 0.4.1-2. Does anyone have any ideas on how to solve this problem??

>>> import suds

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import suds
  File "/usr/lib/pymodules/python2.7/suds/__init__.py", line 154, in <module>
    import client
  File "/usr/lib/pymodules/python2.7/suds/client.py", line 23, in <module>
    import suds.metrics as metrics
  File "/usr/lib/pymodules/python2.7/suds/metrics.py", line 23, in <module>
    from logging import getLogger
ImportError: cannot import name getLogger
>>> 

回答1:


logging is a standard module of Python. There are several possible reasons why Python can't find it anymore:

  1. The is another logging module in the path (print sys.path to get a list of paths Python will search)
  2. Someone changed PYTHONPATH (the default Python search path)
  3. Someone messed with the Python installation (deleted the logging module)


来源:https://stackoverflow.com/questions/6252660/python-suds-importerror-cannot-import-name-getlogger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!