kotaemon icon indicating copy to clipboard operation
kotaemon copied to clipboard

[BUG] - cannot import config from decouple

Open thefirstLeonliao opened this issue 1 year ago • 11 comments

Description

first,cannot find the module name decouple,after pip install decouple, show this

Traceback (most recent call last): File "D:\AI\kotaemon-app\scripts\serve_local.py", line 6, in from decouple import config ImportError: cannot import name 'config' from 'decouple' (D:\AI\kotaemon-app\install_dir\env\lib\site-packages\decouple_init_.py) Press any key to continue . . .

Reproduction steps

i really expecting on this project,please help

Screenshots

No response

Logs

No response

Browsers

No response

OS

No response

Additional information

No response

thefirstLeonliao avatar Sep 06 '24 06:09 thefirstLeonliao

Hi @thefirstLeonliao, It seems like you have an issue with python-decouple package. Please reinstall it following these steps:

  1. Activate kotaemon's conda env:
conda activate D:\AI\kotaemon-app\install_dir\env\
  1. Uninstall decouple:
pip uninstall decouple
  1. Reinstall python-decouple:
pip install python-decouple

cin-albert avatar Sep 06 '24 08:09 cin-albert

thanks you,i now fixed the decouple problem,but them tells me: No module named 'ktem'


Launching Kotaemon in your browser, please wait...


Traceback (most recent call last): File "D:\AI\kotaemon-app\app.py", line 13, in from ktem.main import App # noqa ModuleNotFoundError: No module named 'ktem'

Hi @thefirstLeonliao, 你好 It seems like you have an issue with python-decouple package. Please reinstall it following these steps:似乎您对 python-decouple 包有问题。请按照以下步骤重新安装它:

  1. Activate kotaemon's conda env:激活 kotaemon 的 conda env:
conda activate D:\AI\kotaemon-app\install_dir\env\
  1. Uninstall decouple: 卸载 decouple:
pip uninstall decouple
  1. Reinstall python-decouple:重新安装 python-decouple
pip install python-decouple

thefirstLeonliao avatar Sep 06 '24 10:09 thefirstLeonliao

by the way, i must have llama3.1 8b first?

thefirstLeonliao avatar Sep 06 '24 10:09 thefirstLeonliao

@thefirstLeonliao I doubt that you have problem while installing. Can you try to remove the install_dir, and run the script (run_window.bat if you are window user) to install it again ?

phv2312 avatar Sep 06 '24 13:09 phv2312

@thefirstLeonliao I doubt that you have problem while installing. Can you try to remove the install_dir, and run the script (run_window.bat if you are window user) to install it again ?我怀疑您在安装时有问题。您能否尝试删除install_dir,并运行脚本(如果您是 Windows 用户,则run_window.bat)以再次安装它?

i try that way already, do not work

thefirstLeonliao avatar Sep 06 '24 13:09 thefirstLeonliao

Hmm, Can you try out the following:

conda activate D:\AI\kotaemon-app\install_dir\env\
pip install -e "libs/kotaemon[all]"
pip install -e "libs/ktem"

Then, re-run the script

IF any error occures, besides the log, can you send us the list of installed packages:

conda activate D:\AI\kotaemon-app\install_dir\env\
pip freeze

phv2312 avatar Sep 06 '24 14:09 phv2312

by the way, i must have llama3.1 8b first?

No @thefirstLeonliao. Local models, like llama3.1 8b, is just an option. You can launch the UI without llama3.1 8b installed. Kotaemon is compatible with other vendors such as OpenAI, AzureOpenAI, Groq. Follow this setup to add your model.

cin-albert avatar Sep 06 '24 15:09 cin-albert

conda activate shows error,this is my pip list 微信图片_20240906232820 D:\AI\kotaemon-app\install_dir\env>python.exe -m pip list Package Version


aiofiles 23.2.1 aiohappyeyeballs 2.4.0 aiohttp 3.10.5 aiosignal 1.3.1 annotated-types 0.7.0 anthropic 0.34.2 anyio 4.4.0 arrow 1.3.0 asgiref 3.8.1 async-timeout 4.0.3 attrs 24.2.0 backoff 2.2.1 bcrypt 4.2.0 beautifulsoup4 4.12.3 binaryornot 0.4.4 build 1.2.1 cachetools 5.5.0 certifi 2024.8.30 chardet 5.2.0 charset-normalizer 3.3.2 chroma-hnswlib 0.7.6 chromadb 0.5.5 click 8.1.7 cohere 5.3.5 colorama 0.4.6 coloredlogs 15.0.1 colorlog 6.8.2 contourpy 1.3.0 cookiecutter 2.6.0 cycler 0.12.1 dataclasses-json 0.6.7 decorator 5.1.1 defusedxml 0.7.1 Deprecated 1.2.14 deprecation 2.1.0 dirtyjson 1.0.8 diskcache 5.6.3 distro 1.9.0 environs 9.5.0 et-xmlfile 1.1.0 exceptiongroup 1.2.2 fast-langdetect 0.2.1 fastapi 0.112.1 fastavro 1.9.7 fasttext-wheel 0.9.2 ffmpy 0.4.0 filelock 3.15.4 flatbuffers 24.3.25 fonttools 4.53.1 frozenlist 1.4.1 fsspec 2024.9.0 google-auth 2.34.0 googleapis-common-protos 1.65.0 gradio 4.39.0 gradio_client 1.1.1 greenlet 3.0.3 grpcio 1.66.1 h11 0.14.0 html2text 2024.2.26 httpcore 1.0.5 httptools 0.6.1 httpx 0.27.2 httpx-sse 0.4.0 huggingface-hub 0.24.6 humanfriendly 10.0 idna 3.8 importlib_metadata 8.4.0 importlib_resources 6.4.4 Jinja2 3.1.4 jiter 0.5.0 joblib 1.4.2 jsonpatch 1.33 jsonpointer 3.0.0 kiwisolver 1.4.7 kotaemon 0.4.8 kubernetes 30.1.0 lancedb 0.12.0 langchain 0.1.20 langchain-anthropic 0.1.13 langchain-community 0.0.38 langchain-core 0.1.52 langchain-openai 0.1.7 langchain-text-splitters 0.0.2 langsmith 0.1.115 linkify-it-py 2.0.3 llama-cloud 0.0.17 llama-hub 0.0.79.post1 llama-index 0.10.68 llama-index-agent-openai 0.2.9 llama-index-cli 0.1.13 llama-index-core 0.10.68.post1 llama-index-embeddings-openai 0.1.11 llama-index-indices-managed-llama-cloud 0.2.7 llama-index-legacy 0.9.48.post3 llama-index-llms-openai 0.1.31 llama-index-multi-modal-llms-openai 0.1.9 llama-index-program-openai 0.1.7 llama-index-question-gen-openai 0.1.3 llama-index-readers-file 0.1.33 llama-index-readers-llama-parse 0.1.6 llama-index-vector-stores-chroma 0.1.10 llama-index-vector-stores-lancedb 0.1.7 llama-index-vector-stores-milvus 0.1.23 llama-parse 0.4.9 markdown-it-py 3.0.0 MarkupSafe 2.1.5 marshmallow 3.22.0 matplotlib 3.9.2 mdit-py-plugins 0.4.1 mdurl 0.1.2 mmh3 4.1.0 monotonic 1.6 mpmath 1.3.0 multidict 6.0.5 mypy-extensions 1.0.0 nest-asyncio 1.6.0 networkx 3.3 nltk 3.9.1 numpy 1.26.4 oauthlib 3.2.2 onnxruntime 1.19.2 openai 1.43.1 openpyxl 3.1.5 opentelemetry-api 1.27.0 opentelemetry-exporter-otlp-proto-common 1.27.0 opentelemetry-exporter-otlp-proto-grpc 1.27.0 opentelemetry-instrumentation 0.48b0 opentelemetry-instrumentation-asgi 0.48b0 opentelemetry-instrumentation-fastapi 0.48b0 opentelemetry-proto 1.27.0 opentelemetry-sdk 1.27.0 opentelemetry-semantic-conventions 0.48b0 opentelemetry-util-http 0.48b0 orjson 3.10.7 overrides 7.7.0 packaging 23.2 pandas 2.2.2 pillow 10.4.0 pip 24.2 platformdirs 4.2.2 plotly 5.24.0 posthog 3.6.3 protobuf 4.25.4 psutil 6.0.0 py 1.11.0 pyaml 23.12.0 pyarrow 17.0.0 pyasn1 0.6.0 pyasn1_modules 0.4.0 pybind11 2.13.5 pydantic 2.9.0 pydantic_core 2.23.2 pydub 0.25.1 Pygments 2.18.0 pylance 0.16.0 pymilvus 2.4.6 PyMuPDF 1.24.10 PyMuPDFb 1.24.10 pyparsing 3.1.4 pypdf 4.2.0 PyPika 0.48.9 pyproject_hooks 1.1.0 pyreadline3 3.4.1 python-dateutil 2.9.0.post0 python-decouple 3.8 python-dotenv 1.0.1 python-multipart 0.0.9 python-slugify 8.0.4 pytz 2024.1 PyYAML 6.0.2 ratelimiter 1.2.0.post0 regex 2024.7.24 requests 2.32.3 requests-oauthlib 2.0.0 retry 0.9.2 retrying 1.3.4 rich 13.8.0 robust-downloader 0.0.2 rsa 4.9 ruff 0.6.4 semantic-version 2.10.0 setuptools 72.1.0 shellingham 1.5.4 six 1.16.0 sniffio 1.3.1 soupsieve 2.6 SQLAlchemy 2.0.34 starlette 0.38.4 striprtf 0.0.26 sympy 1.13.2 tantivy 0.22.0 tenacity 8.2.3 text-unidecode 1.3 textual 0.79.1 theflow 0.8.6 tiktoken 0.7.0 tokenizers 0.19.1 tomli 2.0.1 tomlkit 0.12.0 tqdm 4.66.5 trogon 0.5.0 typer 0.12.5 types-python-dateutil 2.9.0.20240906 types-requests 2.32.0.20240905 typing_extensions 4.12.2 typing-inspect 0.9.0 tzdata 2024.1 uc-micro-py 1.0.3 ujson 5.10.0 urllib3 2.2.2 uvicorn 0.30.6 watchfiles 0.24.0 websocket-client 1.8.0 websockets 11.0.3 wheel 0.43.0 wrapt 1.16.0 yarl 1.9.11 zipp 3.20.1

thefirstLeonliao avatar Sep 06 '24 16:09 thefirstLeonliao

by the way, i must have llama3.1 8b first?顺便说一句,我必须先吃 llama3.1 8b?

No @thefirstLeonliao. Local models, like llama3.1 8b, is just an option. You can launch the UI without llama3.1 8b installed.不。本地模型,如 llama3.1 8b,只是一种选择。您可以在未安装 llama3.1 8b 的情况下启动 UI。 Kotaemon is compatible with other vendors such as OpenAI, AzureOpenAI, Groq. Follow this setup to add your model.Kotaemon 与其他供应商兼容,例如 OpenAI、AzureOpenAI、Groq。按照此设置添加您的模型。

i see,thanks for your guys help

thefirstLeonliao avatar Sep 06 '24 16:09 thefirstLeonliao

Sorry, I didn't make it clear at the beginning, I downloaded Kotaemon app.zip from your website at the beginning, so I have the above problem, now I git clone this project, But when I run the pip install -e "libs/kotaemon[all]" command, I get an error, which is shown below

ERROR: Ignored the following versions that require a different python version: 0.0.46 Requires-Python >=3.8.1,<3.12; 0.0.47 Requires-Python >=3.8.1,<3.12; 0.0.47.post1 Requires-Python >=3.8.1,<3.12; 0.0.48 Requires-Python >=3.8.1,<3.12; 0.0.50 Requires-Python >=3.8.1,<3.12; 0.0.52 Requires-Python >=3.8.1,<3.12; 0.0.54 Requires-Python >=3.8.1,<3.12; 0.0.55 Requires-Python >=3.8.1,<3.12; 0.0.55.post1 Requires-Python >=3.8.1,<3.12; 0.0.56 Requires-Python >=3.8.1,<3.12; 0.0.56.post1 Requires-Python >=3.8.1,<3.12; 0.0.57 Requires-Python >=3.8.1,<3.12; 0.0.58 Requires-Python >=3.8.1,<3.12; 0.0.58.post1 Requires-Python >=3.8.1,<3.12; 0.0.59 Requires-Python >=3.8.1,<3.12; 0.0.60 Requires-Python >=3.8.1,<3.12; 0.0.61 Requires-Python >=3.8.1,<3.12; 0.0.62 Requires-Python >=3.8.1,<3.12; 0.0.64 Requires-Python >=3.8.1,<3.12; 0.0.65 Requires-Python >=3.8.1,<3.12; 0.0.66 Requires-Python >=3.8.1,<3.12; 0.0.67 Requires-Python >=3.8.1,<3.12; 0.0.68.post1 Requires-Python >=3.8.1,<3.12; 0.0.69 Requires-Python >=3.8.1,<3.12; 0.0.70 Requires-Python >=3.8.1,<3.12; 0.0.71 Requires-Python >=3.8.1,<3.12; 0.0.72 Requires-Python >=3.8.1,<3.12; 0.0.73 Requires-Python >=3.8.1,<3.12; 0.0.74 Requires-Python >=3.8.1,<3.12; 0.0.75 Requires-Python >=3.8.1,<3.12; 0.0.76 Requires-Python >=3.8.1,<3.12; 0.0.77 Requires-Python >=3.8.1,<3.12; 0.0.78 Requires-Python >=3.8.1,<3.12; 0.0.79 Requires-Python >=3.8.1,<3.12; 0.0.79.post1 Requires-Python >=3.8.1,<3.12; 0.1.0 Requires-Python <3.12,>=3.8; 4.0.0 Requires-Python >=3.7,<3.11 ERROR: Could not find a version that satisfies the requirement llama-hub<0.1.0,>=0.0.79 (from kotaemon) (from versions: 0.0.1a1, 0.0.1a2, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.0.18, 0.0.19, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.24.post1, 0.0.25, 0.0.26, 0.0.27, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45) ERROR: No matching distribution found for llama-hub<0.1.0,>=0.0.79

thefirstLeonliao avatar Sep 06 '24 18:09 thefirstLeonliao

@thefirstLeonliao I doubt you do not have a correct python version, normally we will use conda to create the virtual environment. It's recommend python 3.10 to make kotaemon work normally (From your log above, I see that you python version is != 3.10). Here're some few suggestions:

  • Make sure you git clone the latest version, in branch main.
  • IF you aren't technical member, we provide the scripts/run_window.bat to automatically install conda & dependencies.
  • Otherwise, you can following the instructions on README
conda create -n kotaemon python=3.10
conda activate kotaemon

# clone this repo
git clone https://github.com/Cinnamon/kotaemon
cd kotaemon

pip install -e "libs/kotaemon[all]"
pip install -e "libs/ktem"
  • Or, you can try with docker if you're familar with it

Thanks for your interest in the app

phv2312 avatar Sep 07 '24 06:09 phv2312