vemonet / libre-chat

🦙 Free and Open Source Large Language Model (LLM) chatbot web UI and API. Self-hosted, offline capable and easy to setup. Powered by LangChain.
https://vemonet.github.io/libre-chat
MIT License
134 stars 17 forks source link

Import error about BaseSettings #6

Closed GuoqiangJia closed 10 months ago

GuoqiangJia commented 12 months ago

Describe the bug

I installed libre-chat by using pip install libre-chat, and received the below error when tried to start.

Traceback (most recent call last):
  File "/root/miniconda3/envs/libre/bin/libre-chat", line 5, in <module>
    from libre_chat.__main__ import cli
  File "/root/miniconda3/envs/libre/lib/python3.11/site-packages/libre_chat/__init__.py", line 3, in <module>
    from .chat_conf import default_conf, parse_config
  File "/root/miniconda3/envs/libre/lib/python3.11/site-packages/libre_chat/chat_conf.py", line 4, in <module>
    from pydantic import BaseSettings
  File "/root/miniconda3/envs/libre/lib/python3.11/site-packages/pydantic/__init__.py", line 363, in __getattr__
    return _getattr_migration(attr_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/libre/lib/python3.11/site-packages/pydantic/_migration.py", line 296, in wrapper
    raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.5/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.5/u/import-error

It seems that version 0.04 was installed but not version 0.05. libre-chat version 0.0.5 has not been listed on pypi.org.

Reproduction

pip install libre-chat
libre-chat start  

Operating System

CentOS7.9 and Ubuntu

Libre Chat version

0.0.4

Additional context

No response

npotier commented 11 months ago

Hello, same error for me. Did you find a solution @GuoqiangJia ?

vemonet commented 10 months ago

Hi @npotier and @GuoqiangJia the issue was coming from Pydantic (I use v2, and when you installed you got v1, because I did not specified a version for pydantic)

I fixed the dependencies in the latest releases by making sure pydantic installed is superior to v2

For your information, you could have fixed it by forcing to install pip install libre-chat pydantic>=2.0.0 (you don't need anymore though :) )