localGPT icon indicating copy to clipboard operation
localGPT copied to clipboard

ImportError: cannot import name 'UnstructuredExcelLoader' from 'langchain.document_loaders'

Open johnkmayo opened this issue 1 year ago • 2 comments

I had things working but after I pulled the new code this morning, when I run imgest.py I get a "ImportError: cannot import name 'UnstructuredExcelLoader' from 'langchain.document_loaders'" message.

johnkmayo avatar Jun 08 '23 12:06 johnkmayo

@johnkmayo Please try this: The UnstructuredExcelLoader module was removed from one of the earlier versions of the langchain library. Sorry, I don't know which one specifically. If you are using an older version of the library, you will need to upgrade to a newer version in order to use the UnstructuredExcelLoader module.

Not only this error you had come across so far, You may need to carefully run "pip install -r requirements.txt" to update many python libraries to factor in all the changes since your recent pull. Please see that the "requirements.txt" is also changed yesterday.

Here are the steps on how to upgrade to a newer version of the langchain library:

Uninstall the old version of the library: pip uninstall langchain

Install the new version of the library: pip install langchain

Once you have upgraded to a newer version of the library, you should be able to import the UnstructuredExcelLoader module without any errors.

ashokrs avatar Jun 08 '23 14:06 ashokrs

That seems to have fixed that problem. Thanks!

johnkmayo avatar Jun 08 '23 15:06 johnkmayo