Cannot import etree in debug

Bug #1797445 reported by CoryKramer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Invalid
Undecided
Unassigned

Bug Description

Using a release executable (python.exe) I am able import etree

    from lxml import etree

However if I try to do this from a debug executable (python_d.exe) I get the message

    ImportError: cannot import name 'etree'

I often need to use the debug executable to step across into, for example, debug C++ code from python.

The following is my system information:

Python : sys.version_info(major=3, minor=5, micro=4, releaselevel='final', serial=0)
lxml.etree : (4, 2, 4, 0)
libxml used : (2, 9, 5)
libxml compiled : (2, 9, 5)
libxslt used : (1, 1, 30)
libxslt compiled : (1, 1, 30)

Revision history for this message
scoder (scoder) wrote :

I don't know what exactly "python_d.exe" is. Does it just contain additional debug symbols or is it a dedicated debug build of CPython, with all the additional debug checks? If the latter, then you also need a corresponding build of lxml for it. We don't provide that on PyPI, because as this ticket seems to suggest, it would almost never be used.

Revision history for this message
CoryKramer (coryakramer) wrote : Re: [Bug 1797445] Re: Cannot import etree in debug

Yes it is the latter, python_d is a debug build of Python.
We use it extensively when debugging across language boundaries (e.g.
python bindings around C++ code) in which case we have to match ABI between
the two builds.
We had a similar issue with Numpy which has since been resolved:
https://github.com/numpy/numpy/issues/11508

Essentially the wheel that is published to PyPI would specify the "platform
tag" instead of being "any"
https://www.python.org/dev/peps/pep-0427/#file-format

On Sun, Oct 14, 2018 at 3:05 AM scoder <email address hidden> wrote:

> I don't know what exactly "python_d.exe" is. Does it just contain
> additional debug symbols or is it a dedicated debug build of CPython,
> with all the additional debug checks? If the latter, then you also need
> a corresponding build of lxml for it. We don't provide that on PyPI,
> because as this ticket seems to suggest, it would almost never be used.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1797445
>
> Title:
> Cannot import etree in debug
>
> Status in lxml:
> New
>
> Bug description:
> Using a release executable (python.exe) I am able import etree
>
> from lxml import etree
>
> However if I try to do this from a debug executable (python_d.exe) I
> get the message
>
> ImportError: cannot import name 'etree'
>
> I often need to use the debug executable to step across into, for
> example, debug C++ code from python.
>
> The following is my system information:
>
> Python : sys.version_info(major=3, minor=5, micro=4,
> releaselevel='final', serial=0)
> lxml.etree : (4, 2, 4, 0)
> libxml used : (2, 9, 5)
> libxml compiled : (2, 9, 5)
> libxslt used : (1, 1, 30)
> libxslt compiled : (1, 1, 30)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/lxml/+bug/1797445/+subscriptions
>

Revision history for this message
scoder (scoder) wrote :

lxml's wheel names on PyPI are completely qualified. How do you install lxml in the two interpreters?

Revision history for this message
scoder (scoder) wrote :

This should be resolved in Py3.8, which allows to import normally built extension modules in debug builds.

Changed in lxml:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.