langchain
langchain copied to clipboard
import error ContextualCompressionRetriever
System Info
m1 mac
Who can help?
@hwchase17 @agola11 @eyurtsev
Information
- [ ] The official example notebooks/scripts
- [X] My own modified scripts
Related Components
- [ ] LLMs/Chat Models
- [X] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async
Reproduction
from langchain.retrievers import ContextualCompressionRetriever
NameError: name 'v_args' is not defined
Expected behavior
i had the same problem
i had the same problem
+1
This is because the lark
dependency is not installed. If you look at where v_args
is coming from it is from lark
. It is an optional dependency for some reason. Installing it will fix your issue.
+1.
The decorated func should probably be wrapped in some import/exception clause like for other optional libraries - thanks @tasansal for pointing out the source.
Yea; it does have a try except but I think it has a bug. If it doesn't exist it just doesn't import it hence import error happens.
cc @hwchase17 is this related to the fix you pushed yesterday if not, I'm happy to take a look let me know
cc @hwchase17 is this related to the fix you pushed yesterday if not, I'm happy to take a look let me know
think it's unrelated, taking look now
Hi, @youminxue! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
Based on my understanding, the issue is about an import error for the ContextualCompressionRetriever
module. It seems that the error message indicates that the name 'v_args' is not defined. Several users, including yetilfx and ruyiluo, have also experienced the same problem. tasansal suggests that the issue is caused by the missing lark
dependency and recommends installing it to fix the problem. jphme agrees with tasansal and suggests wrapping the decorated function in an import/exception clause. eyurtsev and dev2049 mention other users to see if the issue is related to a recent fix.
Now, we would like to know if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.
Thank you for your understanding and contribution to the LangChain project! If you have any further questions or concerns, please don't hesitate to let us know.