Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error ContextualCompressionRetriever #3585

Closed
mikelval82 opened this issue Apr 26, 2023 · 2 comments
Closed

import error ContextualCompressionRetriever #3585

mikelval82 opened this issue Apr 26, 2023 · 2 comments

Comments

@mikelval82
Copy link

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.

@jphme
Copy link

jphme commented Apr 26, 2023

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

import langchain
langchain.__version__

?

@dosubot
Copy link

dosubot bot commented Sep 2, 2023

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 dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 2, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants