langchain
langchain copied to clipboard
import error ContextualCompressionRetriever
Hi,
I have installed langchain-0.0.149 using pip. When trying to run the folloging code I get an import error.
from langchain.retrievers import ContextualCompressionRetriever
Traceback (most recent call last): File ".../lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3460, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in from langchain.retrievers import ContextualCompressionRetriever ImportError: cannot import name 'ContextualCompressionRetriever' from 'langchain.retrievers' (.../lib/python3.10/site-packages/langchain/retrievers/init.py)
Thanks in advance, Mikel.
Works for me. Did you maybe install 0.0.149 in a different environment?
import langchain
langchain.__version__
?
Hi, @mikelval82! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you are experiencing an import error when trying to run code that imports the ContextualCompressionRetriever
from the langchain.retrievers
module. It seems that jphme has suggested that the problem might be related to a different environment or version of the package.
Before we close this issue, we wanted to check with you if it 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 it will be automatically closed in 7 days.
Thank you for your understanding and cooperation!