langchain icon indicating copy to clipboard operation
langchain copied to clipboard

No module named 'langchain.document_loaders'

Open sssdjj opened this issue 1 year ago • 1 comments

oduleNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_13968\1686623477.py in ----> 1 from langchain.document_loaders import UnstructuredFileLoader 2 from langchain.embeddings.huggingface import HuggingFaceEmbeddings 3 from langchain.vectorstores import FAISS

ModuleNotFoundError: No module named 'langchain.document_loaders'

sssdjj avatar Apr 20 '23 06:04 sssdjj

try 'pip install langchain'.

or you can clone the repo and install from source as indicated in the docs

nassersaazi avatar Apr 20 '23 08:04 nassersaazi

I was able to resolve this issue. Just update your python3 version to >= 3.10. Follow the instructions here: https://stackoverflow.com/questions/75907516/langchain-no-module-named-langchain-document-loaders

Anirudh257 avatar Jun 03 '23 22:06 Anirudh257

In my case, updating python3 version to 3.8 is the only effective solution, and versions >=3.10 will conflict with faiss-gpu.

Mike4Ellis avatar Sep 11 '23 06:09 Mike4Ellis

I have version 3.11.4 and still have this issue.

nobodyme avatar Sep 20 '23 22:09 nobodyme

Hi, @sssdjj

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue involves a ModuleNotFoundError for 'langchain.document_loaders'. There were various suggestions and resolutions provided by different users, including trying 'pip install langchain', updating Python versions to >= 3.10, and encountering conflicts with faiss-gpu for versions >= 3.10.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, kindly let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

dosubot[bot] avatar Dec 20 '23 16:12 dosubot[bot]

Any alternative for Python 3.9 ?

dimaelzein avatar Dec 26 '23 16:12 dimaelzein

@baskaryan, could you please assist @dimaelzein with finding an alternative for Python 3.9 to resolve the ModuleNotFoundError issue for 'langchain.document_loaders'? Thank you!

dosubot[bot] avatar Dec 26 '23 16:12 dosubot[bot]

In my case, updating python3 version to 3.8 is the only effective solution, and versions >=3.10 will conflict with faiss-gpu.

I face the same issue as well, due to fiass-gpu I had to port down to Python3.10, Now I face langchain_community issue. Can you please assist on which Python version should be used to address these issues so that all the packages can be consumed

Sandeep-madhyastha avatar Jan 10 '24 07:01 Sandeep-madhyastha

I was able to resolve this issue. Just update your python3 version to >= 3.10. Follow the instructions here: https://stackoverflow.com/questions/75907516/langchain-no-module-named-langchain-document-loaders

Mine was resolved using this solution

QuynhTaVo avatar Mar 01 '24 02:03 QuynhTaVo