MasterOfTheHouse
MasterOfTheHouse

Reputation: 1349

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

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

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

Upvotes: 0

Views: 632

Answers (3)

user993669
user993669

Reputation: 19

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

Upvotes: 0

MasterOfTheHouse
MasterOfTheHouse

Reputation: 1349

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

Upvotes: 0

ZKS
ZKS

Reputation: 2876

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,
    )

Upvotes: 1

Related Questions