I tried to run the course codes on local Jupyter notebook by anaconda and getting error on FileSystemBlobLoader

I tried to run the following part of the codes locally
! pip install langchain
from langchain.document_loaders.generic import GenericLoader, FileSystemBlobLoader
from langchain.document_loaders.parsers import OpenAIWhisperParser
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader

but I’ve got the following error when importing the required libraries. What am I missing here?

It looks like you’re encountering this issue because the required components might not be included in the langchain package you’re using.

Try using langchain_community instead of langchain — it should include the missing modules you’re trying to import. Here’s how you can do it:

pip install langchain_community

Then try running your code again, and the imports should work as expected:

from langchain.document_loaders.generic import GenericLoader, FileSystemBlobLoader
from langchain.document_loaders.parsers import OpenAIWhisperParser
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader

Let me know if that works for you!

1 Like

Hi there, I did what you have suggested, but the issue remains. I think is about the line

from langchain.document_loaders.generic import GenericLoader, FileSystemBlobLoader

Here is the error

ImportError                               Traceback (most recent call last)
<ipython-input-25-ecdadf08a9ca> in <cell line: 0>()
----> 1 from langchain.document_loaders.generic import GenericLoader, FileSystemBlobLoader

ImportError: cannot import name 'FileSystemBlobLoader' from 'langchain.document_loaders.generic' (/usr/local/lib/python3.11/dist-packages/langchain/document_loaders/generic.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------