-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
anthropic_version = packaging.version.parse(version("anthropic")) AttributeError: module 'packaging' has no attribute 'version' #7283
Comments
Answer generated by a 🤖 AnswerI understand that you're encountering an To address this issue, I propose the following steps:
pip install packaging importlib_metadata
from importlib.metadata import version
from packaging.version import parse
anthropic_version = parse(version("anthropic")) This solution should resolve the If you find this solution correct and believe it's a bug that could impact other users, you're encouraged to make a pull request to help improve the LangChain project. In case this solution doesn't align with your experience, I would recommend upgrading to the latest version of LangChain, as the issue might have been resolved in a more recent update. SourcesThis response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
I tried to run the same, and I am able to reproduce the same error (AttributeError: module 'packaging' has no attribute 'version')
|
out of curiosity, what python version are you getting issue with? |
- Description: Solving, anthropic packaging version issue by clearing the mixup from package.version that is being confused with version from - importlib.metadata.version. - Issue: it fixes the issue #7283 - Maintainer: @hwchase17 The following change has been explained in the comment - #7283 (comment)
My version is 3.10.12 |
Hi, @junruxiong! I'm Dosu, and I'm helping the LangChain team manage our backlog. I wanted to let you know that we are marking this issue as stale. Based on the information provided, it seems that the issue you reported was related to an error when initializing 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 contribution to the LangChain repository! |
System Info
When I initialise ChatAnthropic(), it got the error:
anthropic_version = packaging.version.parse(version("anthropic"))
AttributeError: module 'packaging' has no attribute 'version'
Who can help?
@hwchase17 @agola11
Information
Related Components
Reproduction
from langchain.chat_models import ChatOpenAI, ChatAnthropic
llm = ChatAnthropic()
Expected behavior
As shown above.
The text was updated successfully, but these errors were encountered: