exchangelib:在OS X系统上寻找winkerberos

时间:2018-07-16 12:58:46

标签: python exchange-server

我正在尝试在Mac(OS X 10.13.5)上安装exchangelib。我在安装时遇到问题,因此我创建了一个最小的工作环境:


pushd /tmp
curl -SLO https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p /tmp/lxml
source /tmp/lxml/bin/activate
conda create -n py35 python=3.5 lxml -y
source activate py35

然后我在该环境中安装了exchangelib。但是,当我尝试使用它时,我发现它正在尝试加载winkerberos而不是pykerberos。


>>> import exchangelib
Traceback (most recent call last):
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 2, in <module>
    import kerberos
ImportError: dlopen(/tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so, 2): Symbol not found: _mempcpy
  Referenced from: /tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so
  Expected in: flat namespace
 in /tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/__init__.py", line 4, in <module>
    from .account import Account
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/account.py", line 12, in <module>
    from exchangelib.services import GetUserOofSettings, SetUserOofSettings
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/services.py", line 37, in <module>
    from .transport import wrap, extra_headers, SOAPNS, TNS, MNS, ENS
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/transport.py", line 9, in <module>
    import requests_kerberos
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/__init__.py", line 17, in <module>
    from .kerberos_ import HTTPKerberosAuth, REQUIRED, OPTIONAL, DISABLED
  File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 4, in <module>
    import winkerberos as kerberos
ImportError: No module named 'winkerberos'
>>>

我有点不知所措。有什么想法如何使安装不寻找Winkerberos?

1 个答案:

答案 0 :(得分:0)

看起来它正在尝试首先加载pykerberos,但由于库问题(未找到符号:_mempcpy )而失败,而回退尝试加载未找到的winkerberos。只要您可以使系统上的pykerberos正常工作,它就应该开始工作。