#1151832 pyxnat: FTBFS: E ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py)

Package:
src:pyxnat
Source:
src:pyxnat
Submitter:
Santiago Vila
Date:
2026-10-24 17:47:01 UTC
Severity:
normal
Tags:
#1151832#5
Date:
2026-10-23 16:45:06 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202610/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:pyxnat, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
    from .select import Select
pyxnat/core/select.py:4: in <module>
    from .search import Search
pyxnat/core/search.py:5: in <module>
    from lxml import etree
E   ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py)
=========================== short test summary info ============================
ERROR pyxnat/tests/array_test.py
ERROR pyxnat/tests/downloadutils_test.py
ERROR pyxnat/tests/experiments_test.py
ERROR pyxnat/tests/graphdata_test.py
ERROR pyxnat/tests/inspector_test.py
ERROR pyxnat/tests/interfaces_test.py
ERROR pyxnat/tests/jsonutil_test.py
ERROR pyxnat/tests/manage_test.py
ERROR pyxnat/tests/pathutil_test.py
ERROR pyxnat/tests/pipelines_test.py
ERROR pyxnat/tests/prearchive_test.py
ERROR pyxnat/tests/repr_test.py
ERROR pyxnat/tests/scans_test.py
ERROR pyxnat/tests/select_test.py
ERROR pyxnat/tests/sessionmirror_test.py
ERROR pyxnat/tests/test_resource_functions.py
ERROR pyxnat/tests/uriutil_test.py
ERROR pyxnat/tests/xpass_test.py
!!!!!!!!!!!!!!!!!!! Interrupted: 18 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 18 errors in 0.39s ==============================
E: pybuild pybuild:485: test: plugin distutils failed with: exit code=2: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.15_pyxnat/build; python3.15 -m pytest
I: pybuild pybuild:390: set -e ; cp -a pyxnat/tests /<<PKGBU [too-long-redacted] uild/pyxnat/tests/xpath_test.py
I: pybuild base:383: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_pyxnat/build; python3.14 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0 -- /usr/bin/python3.14
cachedir: .pytest_cache
rootdir: /<<PKGBUILDDIR>>
configfile: setup.cfg
collecting ... collected 64 items / 1 skipped

pyxnat/tests/array_test.py::ArrayTests::test_array_experiments SKIPPED   [  1%]
pyxnat/tests/array_test.py::ArrayTests::test_array_mrscans SKIPPED (...) [  3%]
pyxnat/tests/array_test.py::ArrayTests::test_array_mrsessions SKIPPED    [  4%]
pyxnat/tests/array_test.py::ArrayTests::test_array_scans SKIPPED (Sk...) [  6%]
pyxnat/tests/array_test.py::ArrayTests::test_search_experiments SKIPPED  [  7%]
pyxnat/tests/downloadutils_test.py::test_download SKIPPED (Skipping ...) [  9%]
pyxnat/tests/experiments_test.py::test_global_experiment_listing SKIPPED [ 10%]
pyxnat/tests/graphdata_test.py::test_graphdata SKIPPED (Skipping sin...) [ 12%]
pyxnat/tests/graphdata_test.py::test_schemasinspector SKIPPED (Skipp...) [ 14%]
pyxnat/tests/graphdata_test.py::test_paintgraph SKIPPED (Skipping si...) [ 15%]
pyxnat/tests/inspector_test.py::test_inspector_structure SKIPPED (Sk...) [ 17%]
pyxnat/tests/interfaces_test.py::test_simple_object_listing PASSED       [ 18%]
pyxnat/tests/interfaces_test.py::test_simple_path_listing PASSED         [ 20%]
pyxnat/tests/interfaces_test.py::test_nested_object_listing PASSED       [ 21%]
pyxnat/tests/interfaces_test.py::test_nested_path_listing PASSED         [ 23%]
pyxnat/tests/interfaces_test.py::test_search_access SKIPPED (Skippin...) [ 25%]
pyxnat/tests/interfaces_test.py::test_connection_with_explicit_parameters PASSED [ 26%]
pyxnat/tests/interfaces_test.py::test_anonymous_access PASSED            [ 28%]
pyxnat/tests/interfaces_test.py::test_close_jsession SKIPPED (Skippi...) [ 29%]
pyxnat/tests/interfaces_test.py::test_save_config PASSED                 [ 31%]
pyxnat/tests/interfaces_test.py::test_save_config_home_dir PASSED        [ 32%]
pyxnat/tests/interfaces_test.py::test_save_config_current_dir PASSED     [ 34%]
pyxnat/tests/interfaces_test.py::test_version SKIPPED (Skipping sinc...) [ 35%]
pyxnat/tests/interfaces_test.py::test_login_using_explicit_credentials PASSED [ 37%]
pyxnat/tests/jsonutil_test.py::test_dump_methods PASSED                  [ 39%]
pyxnat/tests/jsonutil_test.py::test_get_item_str_value PASSED            [ 40%]
pyxnat/tests/jsonutil_test.py::test_get_item_int_value PASSED            [ 42%]
pyxnat/tests/jsonutil_test.py::test_get_item_list_value PASSED           [ 43%]
pyxnat/tests/jsonutil_test.py::test_join PASSED                          [ 45%]
pyxnat/tests/manage_test.py::test_register_callback PASSED               [ 46%]
pyxnat/tests/manage_test.py::test_unregister_callback PASSED             [ 48%]
pyxnat/tests/manage_test.py::test_add_schema SKIPPED (Skipping since...) [ 50%]
pyxnat/tests/pathutil_test.py::test_pathutil_find_files PASSED           [ 51%]
pyxnat/tests/pipelines_test.py::test_pipelines_info SKIPPED (Skippin...) [ 53%]
pyxnat/tests/pipelines_test.py::test_pipelines_aliases SKIPPED (Skip...) [ 54%]
pyxnat/tests/pipelines_test.py::test_pipeline_info SKIPPED (Skipping...) [ 56%]
pyxnat/tests/pipelines_test.py::test_pipeline_run SKIPPED (Skipping ...) [ 57%]
pyxnat/tests/pipelines_test.py::test_pipeline_status SKIPPED (Skippi...) [ 59%]
pyxnat/tests/prearchive_test.py::test_prearchive_get SKIPPED (Skippi...) [ 60%]
pyxnat/tests/prearchive_test.py::test_prearchive_status SKIPPED (Ski...) [ 62%]
pyxnat/tests/scans_test.py::test_global_scan_listing SKIPPED (Skippi...) [ 64%]
pyxnat/tests/select_test.py::test_switch_to_singular PASSED              [ 65%]
pyxnat/tests/select_test.py::test_switch_to_plural PASSED                [ 67%]
pyxnat/tests/select_test.py::test_complete_stars_plural PASSED           [ 68%]
pyxnat/tests/select_test.py::test_complete_stars_singular PASSED         [ 70%]
pyxnat/tests/select_test.py::test_simple_root_expand PASSED              [ 71%]
pyxnat/tests/select_test.py::test_simple_level_expand PASSED             [ 73%]
pyxnat/tests/select_test.py::test_leaf_level_expand PASSED               [ 75%]
pyxnat/tests/select_test.py::test_double_level_expand PASSED             [ 76%]
pyxnat/tests/select_test.py::test_compute_all PASSED                     [ 78%]
pyxnat/tests/sessionmirror_test.py::test_001_sessionmirror SKIPPED (...) [ 79%]
pyxnat/tests/sessionmirror_test.py::test_002_delete_experiment SKIPPED   [ 81%]
pyxnat/tests/test_resource_functions.py::test_ashs_volumes SKIPPED (...) [ 82%]
pyxnat/tests/uriutil_test.py::test_translate_uri PASSED                  [ 84%]
pyxnat/tests/uriutil_test.py::test_inv_translate_uri PASSED              [ 85%]
pyxnat/tests/uriutil_test.py::test_join_uri PASSED                       [ 87%]
pyxnat/tests/uriutil_test.py::test_uri_last PASSED                       [ 89%]
pyxnat/tests/uriutil_test.py::test_uri_nextlast PASSED                   [ 90%]
pyxnat/tests/uriutil_test.py::test_uri_parent PASSED                     [ 92%]
pyxnat/tests/uriutil_test.py::test_uri_grandparent PASSED                [ 93%]
pyxnat/tests/uriutil_test.py::test_uri_split PASSED                      [ 95%]
pyxnat/tests/xpass_test.py::test_find_plus_line PASSED                   [ 96%]
pyxnat/tests/xpass_test.py::test_find_token PASSED                       [ 98%]
pyxnat/tests/xpass_test.py::test_parse_xnat_pass PASSED                  [100%]

=============================== warnings summary ===============================
pyxnat/core/errors.py:40
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_pyxnat/build/pyxnat/core/errors.py:40: SyntaxWarning: 'return' in a 'finally' block
    return error

#1151832#10
Date:
2026-10-24 17:37:50 UTC
From:
To:
Hi,

it seems this bug is caused by the fact that python3-lxml hasn't been
rebuilt for 3.15 (python3-defaults still lists 3.15 as supported while
an rdep lacks the extension), thats'’s a transition problem (Doko,
please correct me if I'm wrong).

I could possibly build pyxnat by adding

   export PYBUILD_DISABLE_python3.15=test

to debian/rules - but I wonder whether it helps in the long run to
do so.

Kind regards
   Andreas.

#1151832#17
Date:
2026-10-24 17:45:29 UTC
From:
To:
severity 1151832 important
thanks

Please ignore this bug until the package is buildable again
(which will probably happen when the transition has progressed enough).

I'm downgrading it so that it's not a burden.

Thanks.