cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Notebook Langchain ModuleNotFoundError: No module named 'langchain.retrievers.merger_retriever'

bento
New Contributor

Hi,
As mentioned in the title, receiving this error despite

%pip install --upgrade langchain

Specific line of code:

from langchain.retrievers.merger_retriever import MergerRetriever
 
All other langchain import works when this is commented out. Same line works on my local VS Code.
Appreciate any help with this issue. Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions

sean_owen
Databricks Employee
Databricks Employee

More specifically: langchain releases a new update every few days, and it is likely that you are using code or a library that needs a later version of langchain than you have (or, perhaps, a later version that removed whatever part of langchain you rely on). You need to figure out what version of langchain works for your use case and pin it. Updating to the latest version every time makes you vulnerable to breaking changes like this.

View solution in original post

1 REPLY 1

sean_owen
Databricks Employee
Databricks Employee

More specifically: langchain releases a new update every few days, and it is likely that you are using code or a library that needs a later version of langchain than you have (or, perhaps, a later version that removed whatever part of langchain you rely on). You need to figure out what version of langchain works for your use case and pin it. Updating to the latest version every time makes you vulnerable to breaking changes like this.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group