langchain installtion issue: retrievers subpackge not installing, llms.bedrok does appear neither ConversationRetrievalChain from langchain.chains

275 views Asked by At

After I install langchain with pip install I can not find the following sub-packages/objects:

  • retrievers subpackage not installing and directory langchain/retrievers not appearing at all
  • AmazonKendraRetriever does no appear of ourse
  • bedrock does not appear inside directory langchain/llms neither in init
  • ConversationLRetrievalChain does not appear under langchain/chains or init

I tried in requirements.txt the below combinations, but none solved the issue

requirements.txt

langchain
langchain[all]
langchain.retrievers

I'm pining a --python-version 311 and also --platform manylinux1X86_64 to pip install to have no issues with pydantic.

How to solve this issue ?? Thanks

3

There are 3 answers

0
MasterOfTheHouse On BEST ANSWER

The issue is that limiting the installation as I did above will always left outside libraries that have no wheels. So this method should not be used unless you are aware that all subpackges do have wheels. Use a contanarized lambda layer instead was the solution

0
ZKS On

Could you try below steps.

Create a virtual environment using the command

 python -m venv my_venv_name

Activate the virtual environment by executing source

 my_venv_name/bin/activate

PIP install libraries

pip install langchain
pip install """Other required libraries like OpenAI etc..

You should now successfully able to import

 from langchain.chains import ConversationalRetrievalChain
 from langchain.chains import LLMChain, ConversationChain
 from langchain.memory import ConversationBufferMemory
 from langchain.prompts import PromptTemplate
 from langchain.prompts.chat import (
    ChatPromptTemplate,
    SystemMessagePromptTemplate,
    HumanMessagePromptTemplate,
    )
1
user993669 On

Creating a virtual environment solved the issue as mentioned by ZKS use my_venv_name/scripts/activate