langchain icon indicating copy to clipboard operation
langchain copied to clipboard

import error ContextualCompressionRetriever

Open mikelval82 opened this issue 1 year ago • 1 comments

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.

mikelval82 avatar Apr 26 '23 10:04 mikelval82

Works for me. Did you maybe install 0.0.149 in a different environment?

import langchain
langchain.__version__

?

jphme avatar Apr 26 '23 20:04 jphme

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!

dosubot[bot] avatar Sep 02 '23 16:09 dosubot[bot]