llamaIndex - 💡(How to fix) Fix [Question]: download_loader cannot be imported from llama_index [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

hatch run unit ============================= test session starts ============================= platform win32 -- Python 3.12.12, pytest-9.0.3, pluggy-1.6.0
rootdir: E:\haystack-core-integrations\integrations\llama_hub
configfile: pyproject.toml
plugins: anyio-4.13.0 collecting 0 items / 1 error
collected 0 items / 1 error

=================================== ERRORS ==================================== __________________ ERROR collecting tests/test_connector.py ___________________ ImportError while importing test module 'E:\haystack-core-integrations\integrations\llama_hub\tests\test_connector.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: C:\Users\Anshu Singh\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\importlib_init_.py:90: in import_module
return _bootstrap.gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests\test_connector.py:3: in <module> from haystack_integrations.components.connectors.llamahub.connector import ( src\haystack_integrations\components\connectors\llamahub_init
.py:1: in <module> from haystack_integrations.components.connectors.llamahub.connector import ( src\haystack_integrations\components\connectors\llamahub\connector.py:3: in <module> from llama_index import download_loader E ImportError: cannot import name 'download_loader' from 'llama_index' (unknown location)
=========================== short test summary info =========================== ERROR tests/test_connector.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! ============================== 1 error in 1.90s ===============================

Fix Action

Fixed

Code Example

hatch run unit
============================= test session starts =============================
platform win32 -- Python 3.12.12, pytest-9.0.3, pluggy-1.6.0      
rootdir: E:\haystack-core-integrations\integrations\llama_hub     
configfile: pyproject.toml       
plugins: anyio-4.13.0
collecting 0 items / 1 error                                      
collected 0 items / 1 error                                       


=================================== ERRORS ====================================
__________________ ERROR collecting tests/test_connector.py ___________________
ImportError while importing test module 'E:\haystack-core-integrations\integrations\llama_hub\tests\test_connector.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\Anshu Singh\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\importlib\__init__.py:90: in import_module   
    return _bootstrap._gcd_import(name[level:], package, level)   
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   
tests\test_connector.py:3: in <module>
    from haystack_integrations.components.connectors.llamahub.connector import (
src\haystack_integrations\components\connectors\llamahub\__init__.py:1: in <module>
    from haystack_integrations.components.connectors.llamahub.connector import (
src\haystack_integrations\components\connectors\llamahub\connector.py:3: in <module>
    from llama_index import download_loader
E   ImportError: cannot import name 'download_loader' from 'llama_index' (unknown location)        
=========================== short test summary info ===========================
ERROR tests/test_connector.py    
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 1.90s ===============================
RAW_BUFFERClick to expand / collapse

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

hatch run unit
============================= test session starts =============================
platform win32 -- Python 3.12.12, pytest-9.0.3, pluggy-1.6.0      
rootdir: E:\haystack-core-integrations\integrations\llama_hub     
configfile: pyproject.toml       
plugins: anyio-4.13.0
collecting 0 items / 1 error                                      
collected 0 items / 1 error                                       


=================================== ERRORS ====================================
__________________ ERROR collecting tests/test_connector.py ___________________
ImportError while importing test module 'E:\haystack-core-integrations\integrations\llama_hub\tests\test_connector.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\Anshu Singh\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\importlib\__init__.py:90: in import_module   
    return _bootstrap._gcd_import(name[level:], package, level)   
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   
tests\test_connector.py:3: in <module>
    from haystack_integrations.components.connectors.llamahub.connector import (
src\haystack_integrations\components\connectors\llamahub\__init__.py:1: in <module>
    from haystack_integrations.components.connectors.llamahub.connector import (
src\haystack_integrations\components\connectors\llamahub\connector.py:3: in <module>
    from llama_index import download_loader
E   ImportError: cannot import name 'download_loader' from 'llama_index' (unknown location)        
=========================== short test summary info ===========================
ERROR tests/test_connector.py    
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 1.90s ===============================

There was an error saying can import download loader from llama_index I was trying to integrate llama_index to haystack and this shows up while importing

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING