Python pyad issue: AttributeError: module 'pyad.pyad' has no attribute 'adquery'

Python pyad issue: AttributeError: module 'pyad.pyad' has no attribute 'adquery'

我在尝试使用 Python 的 pyad 模块时遇到问题。

from pyad import *
pyad.set_defaults(ldap_server=adserver, username="", password="")
q = pyad.adquery.ADQuery()
-------------------------
AttributeError: module 'pyad.pyad' has no attribute 'adquery'

Windows10; Python3.8.3;我强制安装了 pyad 和 pywin32

非常感谢任何帮助!

尝试使用 import pyad.adquery 而不是 from pyad import *,例如 their examples show

这可能不是问题所在。 pyad库does define __all__ in their code, but there seems to be a lot of caveats to how import * works,值得一试