linkedin / linkedin/pyexchange

ImportError: cannot import name etree

Open
#80 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
154
Forks
91
PR merge metrics
No merged PRs in 30d

Description

Hi!

I could not import pyexchange 0.6 (installed via `pip install pyexchange` on babun/Cygwin on Windows 10) using ipython 2 nor 3:

```
Python 3.6.1 (default, Mar 24 2017, 12:50:34)
Type "copyright", "credits" or "license" for more information.

IPython 4.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: import pyexchange
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in ()
----> 1 import pyexchange

/cygdrive/c/python36/lib/site-packages/pyexchange/__init__.py in ()
6 """
7 import logging
----> 8 from .exchange2010 import Exchange2010Service # noqa
9 from .connection import ExchangeNTLMAuthConnection # noqa
10

/cygdrive/c/python36/lib/site-packages/pyexchange/exchange2010/__init__.py in ()
9 from ..base.calendar import BaseExchangeCalendarEvent, BaseExchangeCalendarService, ExchangeEventOrganizer, ExchangeEventResponse
10 from ..base.folder import BaseExchangeFolder, BaseExchangeFolderService
---> 11 from ..base.soap import ExchangeServiceSOAP
12 from ..exceptions import FailedExchangeException, ExchangeStaleChangeKeyException, ExchangeItemNotFoundException, ExchangeInternalServerTransientErrorException, ExchangeIrresolvableConflictException, InvalidEventType
13 from ..compat import BASESTRING_TYPES

/cygdrive/c/python36/lib/site-packages/pyexchange/base/soap.py in ()
7 import logging
8
----> 9 from lxml import etree
10 from lxml.builder import ElementMaker
11 from datetime import datetime

ImportError: cannot import name 'etree'
```

I tried to install etree via pip:

```
Collecting etree
Could not find a version that satisfies the requirement etree (from versions: )
No matching distribution found for etree
```

So I tried ipython2 as well:

```
Python 2.7.13 (default, Mar 14 2017, 23:27:55)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexchange
Traceback (most recent call last):
File "", line 1, in
File "/cygdrive/c/python36/lib/site-packages/pyexchange/__init__.py", line 8, in
from .exchange2010 import Exchange2010Service # noqa
File "/cygdrive/c/python36/lib/site-packages/pyexchange/exchange2010/__init__.py", line 11, in
from ..base.soap import ExchangeServiceSOAP
File "/cygdrive/c/python36/lib/site-packages/pyexchange/base/soap.py", line 9, in
from lxml import etree
ImportError: cannot import name etree
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing `import pyexchange` in the reported Python and Cygwin environments, then read `pyexchange/base/soap.py` at its `from lxml import etree` import. Check the installed package and its declared dependencies; done means the package imports successfully in the supported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.