Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'download_loader' from 'llama_index' #2

Open
94bb494nd41f opened this issue May 24, 2023 · 1 comment

Comments

@94bb494nd41f
Copy link

94bb494nd41f commented May 24, 2023

so i did a fresh install (pip install -r requirements.txt) in conda and stumbled across this error

As you might see in my profile i do not open issues that often, please tell me if i need to provide more information

Network URL: http://192.168.178.82:8501

2023-05-24 20:16:32.238 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
  exec(code, module.__dict__)
File "C:\Users\derdi\local_llama\local_llama.py", line 2, in <module>
  from llama_index import download_loader, SimpleDirectoryReader, ServiceContext, LLMPredictor, GPTVectorStoreIndex, \
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\__init__.py", line 18, in <module>
  from llama_index.indices.common.struct_store.base import SQLDocumentContextBuilder
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\__init__.py", line 4, in <module>
  from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\keyword_table\__init__.py", line 4, in <module>
  from llama_index.indices.keyword_table.base import GPTKeywordTableIndex
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\keyword_table\base.py", line 18, in <module>
  from llama_index.indices.base import BaseGPTIndex
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\base.py", line 8, in <module>
  from llama_index.indices.base_retriever import BaseRetriever
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\base_retriever.py", line 5, in <module>
  from llama_index.indices.query.schema import QueryBundle, QueryType
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\query\__init__.py", line 3, in <module>
  from llama_index.indices.query.response_synthesis import ResponseSynthesizer
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\query\response_synthesis.py", line 5, in <module>
  from llama_index.indices.postprocessor.types import BaseNodePostprocessor
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\postprocessor\__init__.py", line 4, in <module>
  from llama_index.indices.postprocessor.node import (
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\indices\postprocessor\node.py", line 236, in <module>
  class AutoPrevNextNodePostprocessor(BasePydanticNodePostprocessor):
File "pydantic\main.py", line 197, in pydantic.main.ModelMetaclass.__new__
File "pydantic\fields.py", line 506, in pydantic.fields.ModelField.infer
File "pydantic\fields.py", line 436, in pydantic.fields.ModelField.__init__
File "pydantic\fields.py", line 557, in pydantic.fields.ModelField.prepare
File "pydantic\fields.py", line 831, in pydantic.fields.ModelField.populate_validators
File "pydantic\validators.py", line 725, in find_validators
File "pydantic\dataclasses.py", line 478, in make_dataclass_validator
File "pydantic\dataclasses.py", line 231, in pydantic.dataclasses.dataclass
File "pydantic\dataclasses.py", line 224, in pydantic.dataclasses.dataclass.wrap
File "pydantic\dataclasses.py", line 347, in pydantic.dataclasses._add_pydantic_validation_attributes
File "pydantic\dataclasses.py", line 400, in pydantic.dataclasses.create_pydantic_model_from_dataclass
File "pydantic\main.py", line 1026, in pydantic.main.create_model
File "pydantic\main.py", line 197, in pydantic.main.ModelMetaclass.__new__
File "pydantic\fields.py", line 506, in pydantic.fields.ModelField.infer
File "pydantic\fields.py", line 436, in pydantic.fields.ModelField.__init__
File "pydantic\fields.py", line 552, in pydantic.fields.ModelField.prepare
File "pydantic\fields.py", line 639, in pydantic.fields.ModelField._type_analysis
File "C:\Users\derdi\.conda\envs\quanization\lib\typing.py", line 1498, in __instancecheck__
  raise TypeError("Instance and class checks can only be used with"
TypeError: Instance and class checks can only be used with @runtime_checkable protocols
2023-05-24 20:16:32.512 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
  exec(code, module.__dict__)
File "C:\Users\derdi\local_llama\local_llama.py", line 2, in <module>
  from llama_index import download_loader, SimpleDirectoryReader, ServiceContext, LLMPredictor, GPTVectorStoreIndex, \
ImportError: cannot import name 'download_loader' from 'llama_index' (C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\__init__.py)
2023-05-24 20:16:32.514 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
  exec(code, module.__dict__)
File "C:\Users\derdi\local_llama\local_llama.py", line 2, in <module>
  from llama_index import download_loader, SimpleDirectoryReader, ServiceContext, LLMPredictor, GPTVectorStoreIndex, \
ImportError: cannot import name 'download_loader' from 'llama_index' (C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\__init__.py)
2023-05-24 20:16:32.596 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\derdi\.conda\envs\quanization\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
  exec(code, module.__dict__)
File "C:\Users\derdi\local_llama\local_llama.py", line 2, in <module>
  from llama_index import download_loader, SimpleDirectoryReader, ServiceContext, LLMPredictor, GPTVectorStoreIndex, \
ImportError: cannot import name 'download_loader' from 'llama_index' (C:\Users\derdi\.conda\envs\quanization\lib\site-packages\llama_index\__init__.py)

Edit: created a ticket run-llama/llama_index#3869

@94bb494nd41f
Copy link
Author

switching to python 3.9.16 avoids the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant