首页 > 解决方案 > exchangelib:在 OS X 系统上寻找 winkerberos

问题描述

我正在尝试在 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?

标签: pythonexchange-server

解决方案


看起来它正在尝试首先加载 pykerberos,但由于库问题(未找到符号:_mempcpy)而失败,并且作为后备尝试加载未找到的 winkerberos。一旦您可以使系统上的 pykerberos 工作,这应该开始工作。


推荐阅读