-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug] ModuleNotFoundError: No module named 'mistralai.models.chat_completion' #677
Comments
The error you're encountering, Steps to Fix:1. Check the Available Modules in the Installed Version of MistralaiIt's possible that the structure of the
2. Consult Mistralai Documentation/Changelog
3. Use the Correct VersionSince you've already tried several versions, it's important to figure out if the
For example: pip install mistralai==1.1.0
4. Explore an Alternative ApproachIf you cannot find the
5. Use a Virtual Environment to Isolate DependenciesIf there are potential conflicts with other libraries or previous installations of
6. Check for Open Issues or Report Your OwnSince you've mentioned that this bug was reported before in issue [#640](https://github.com/mistralai/mistralai/issues/640), it's possible that the maintainers are already aware of the issue, and there may be a fix or workaround suggested in the comments. Make sure to check that issue for any updates. If there is no solution yet, consider posting your own detailed bug report on GitHub:
Let me know how these steps go, and if you need more assistance, feel free to ask! |
@micedevai Thank you so much for the help. I found this article (https://github.com/mistralai/client-python/blob/d14559af390123cbd2d923e1e05f780500ce5411/MIGRATION.md?plain=1#L78) and it solves my problem. Based on this article, chat_completion.py is deprecated. |
@WahahaZeng, You're welcome! I'm glad the article helped solve your problem. It’s good to know that the |
Describe the bug
Traceback (most recent call last):
File "/home/xyz/HarmBench/generate_completions.py", line 9, in
from api_models import api_models_map
File "/home/xyz/HarmBench/api_models.py", line 11, in
from mistralai.models.chat_completion import ChatMessage
ModuleNotFoundError: No module named 'mistralai.models.chat_completion'
The version is am using is the latest one
$ pip list |grep mistralai
mistralai 1.2.5
I also tried some old version like "mistralai==1.2.0", "mistralai==1.0.1", but the bug is still there
This bug was reported before in #640
The text was updated successfully, but these errors were encountered: