llama_index icon indicating copy to clipboard operation
llama_index copied to clipboard

Cannot find reference 'download_loader' in '__init__.py'

Open fredzannarbor opened this issue 2 years ago • 6 comments


from gpt_index import GPTListIndex, download_loader

PandasCSVReader = download_loader("PandasCSVReader")

PyCharm Error:(5, 37) Cannot find reference 'download_loader' in '__init__.py'

It does, however, run successfully.

fredzannarbor avatar Feb 19 '23 09:02 fredzannarbor

I tried this one too, but didn't work. from gpt_index.readers.download import download_loader

srinimanickam avatar Feb 19 '23 14:02 srinimanickam

Hmm weird. I'm not sure, does this work without error in a normal python interpreter?

jerryjliu avatar Feb 19 '23 17:02 jerryjliu

@srinimanickam @fredzannarbor Upgrading to latest version of gpt_index should fix the issue.

emptycrown avatar Feb 20 '23 03:02 emptycrown

@emptycrown I just used the latest version and getting the same error. Doesn't seem to work

mangate avatar Feb 20 '23 12:02 mangate

ImportError Traceback (most recent call last) Cell In [117], line 2 1 import gpt_index ----> 2 from gpt_index import download_loader 3 import os 4 gpt_index.download_loader('NotionPageReader')

ImportError: cannot import name 'download_loader' from 'gpt_index' (c:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\gpt_index_init_.py)

mangate avatar Feb 20 '23 12:02 mangate

Name: gpt-index Version: 0.4.7

mangate avatar Feb 20 '23 12:02 mangate

@mangate does this work with a python interpreter?

jerryjliu avatar Feb 20 '23 18:02 jerryjliu

Hi, this was solved, apparently installing gpt-index directly instead of llama-index solves this (I guess llama-index doesn't use the latest version of gpt-index)

mangate avatar Feb 21 '23 08:02 mangate

@mangate Ohhhh I see, you were using llama-index.

Just a heads up, llamahub now uses llama_index imports by default. If you upgrade to the latest version (v0.4.8), please set use_gpt_index_import=True during the download_loader call.

download loader with apt index

will send out a broader announcement about this soon!

jerryjliu avatar Feb 21 '23 08:02 jerryjliu