导入错误:无法导入名称ExchangeNTLMAuthConnection

时间:2017-05-22 03:25:09

标签: python python-2.7 pyexchange

这是我的python错误堆栈跟踪。我正在使用pyexchange,一个用于与Microsoft Exchange服务器交互的包。

我想知道哪个部分完全失败了。它有很多依赖项,我在安装其中一些时遇到了问题--lxml,libxml2,urllib3等。

我在Windows 7上运行它。在MacOS X上,它运行顺畅。只有在Windows上,我才有这些问题。我怀疑没有正确安装的东西,但不确定是什么。当我尝试重新安装软件包时,它表示满足要求。尝试升级。

Traceback (most recent call last):


File "calendar.py", line 1, in <module>
    from pyexchange import Exchange2010Service, ExchangeNTLMAuthConnection
  File "C:\Python27\lib\site-packages\pyexchange\__init__.py", line 9, in <modul
e>
    from .connection import ExchangeNTLMAuthConnection  # noqa
  File "C:\Python27\lib\site-packages\pyexchange\connection.py", line 7, in <mod
ule>
    import requests
  File "C:\Python27\lib\site-packages\requests\__init__.py", line 60, in <module
>
    from .packages.urllib3.exceptions import DependencyWarning
  File "C:\Python27\lib\site-packages\requests\packages\__init__.py", line 29, i
n <module>
    import urllib3
  File "C:\Python27\lib\site-packages\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "C:\Python27\lib\site-packages\urllib3\connectionpool.py", line 35, in <m
odule>
    from .request import RequestMethods
  File "C:\Python27\lib\site-packages\urllib3\request.py", line 3, in <module>
    from .filepost import encode_multipart_formdata
  File "C:\Python27\lib\site-packages\urllib3\filepost.py", line 9, in <module>
    from .fields import RequestField
  File "C:\Python27\lib\site-packages\urllib3\fields.py", line 2, in <module>
    import email.utils
  File "C:\Python27\lib\email\utils.py", line 32, in <module>
    from email._parseaddr import quote
  File "C:\Python27\lib\email\_parseaddr.py", line 16, in <module>
    import time, calendar
  File "c:\alexa-calendar\calendar.py", line 1, in <module>
    from pyexchange import Exchange2010Service, ExchangeNTLMAuthConnection
ImportError: cannot import name ExchangeNTLMAuthConnection

1 个答案:

答案 0 :(得分:1)

根据当前共享的日志,您的Windows操作系统上安装的Python发行版似乎不提供程序包ExchangeNTLMAuthConnection

使用以下命令安装

pip install ExchangeNTLMAuthConnection