Skip to content

cannot import name 'AsyncCallbackManager' from 'langchain.callbacks.base' (/Users/friahi/Library/Python/3.9/lib/python/site-packages/langchain/callbacks/base.py) #69

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

Open
friahi65 opened this issue May 1, 2023 · 12 comments · May be fixed by #91

Comments

@friahi65
Copy link

friahi65 commented May 1, 2023

the versions in the requirement files were not locked, so the AsyncCallbackManager no longer exists in the langchain/callbacks/base.py.

@dahaoGPT
Copy link

dahaoGPT commented May 1, 2023

could u tell me which version I need?

@friahi65
Copy link
Author

friahi65 commented May 1, 2023

I don't know either, it has to go through langchain and see which version had that AsyncCallbackManager or update the code to the newest version of langchain

@completelyboofyblitzed
Copy link

'AsyncCallbackManager' can be imported from 'langchain.callbacks.manager' now instead. At least worked for me.

@SilverNine
Copy link

'AsyncCallbackManager' can be imported from 'langchain.callbacks.manager' now instead. At least worked for me.

I'm getting this error, is there any further solution?
ERROR:root:maximum recursion depth exceeded

@HKAB
Copy link

HKAB commented May 2, 2023

I managed to run the project (langchain==0.0.154) with the following changes:

  • from langchain.callbacks.manager import AsyncCallbackManager
  • ERROR:root:maximum recursion depth exceeded: Using shallow copy instead of deep copy (copy.deepcopy ->copy.copy) in manager.py#L719. It's a problem copying websocket in StreamingLLMCallbackHandler and QuestionGenCallbackHandler. I think there are other ways that doesn't require to change langchain code, just make sure deepcopy work.
  • Using ConversationalRetrievalChain instead of ChatVectorDBChain like this pull request

@completelyboofyblitzed
Copy link

@HKAB did you use solutions for ERROR:root:ChatVectorDBChain does not support async from the pull request as well?

@HKAB
Copy link

HKAB commented May 2, 2023

@HKAB did you use solutions for ERROR:root:ChatVectorDBChain does not support async from the pull request as well?

Yes, I edited my answer.

@dahaoGPT
Copy link

dahaoGPT commented May 2, 2023

I managed to run the project (langchain==0.0.154) with the following changes:

  • from langchain.callbacks.manager import AsyncCallbackManager
  • ERROR:root:maximum recursion depth exceeded: Using shallow copy instead of deep copy (copy.deepcopy ->copy.copy) in manager.py#L719. It's a problem copying websocket in StreamingLLMCallbackHandler and QuestionGenCallbackHandler. I think there are other ways that doesn't require to change langchain code, just make sure deepcopy work.
  • Using ConversationalRetrievalChain instead of ChatVectorDBChain like this pull request

hi , i follow your second step and modify the source code ,but it does not work ,i still get the error'ERROR:root:maximum recursion depth exceeded', so what i can do more?
image

i modify another (deepcopy->copy), it works now ,thx u.

@SilverNine
Copy link

'AsyncCallbackManager' can be imported from 'langchain.callbacks.manager' now instead. At least worked for me.

I'm getting this error, is there any further solution? ERROR:root:maximum recursion depth exceeded

Resolved after updating to langchain==0.0.156.

@xuanlinh91
Copy link

xuanlinh91 commented Jun 2, 2023

Still have this problem with langchain=0.0.188

@r0mdau r0mdau linked a pull request Jun 10, 2023 that will close this issue
@r0mdau
Copy link

r0mdau commented Jun 10, 2023

I opened a PR to solve this issue #91

@ZhangYi1212
Copy link

langchain==0.0.150 solved the problem

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

Successfully merging a pull request may close this issue.

8 participants