chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
32.09k stars 5.58k forks source link

[BUG] startup.py 启动报错 FileNotFoundError: [Errno 2] No such file or directory: 'streamlit' #2146

Closed WangXBruc closed 12 months ago

WangXBruc commented 12 months ago

问题描述 / Problem Description 使用 startup.py 启动,报错 FileNotFoundError: [Errno 2] No such file or directory: 'streamlit'

实际结果 / Actual Result 描述实际发生的结果 / Describe the actual result. python3 startup.py -a

` ==============================Langchain-Chatchat Configuration============================== 操作系统:macOS-13.2.1-arm64-arm-64bit. python版本:3.9.6 (default, May 7 2023, 23:32:44) [Clang 14.0.3 (clang-1403.0.22.14.1)] 项目版本:v0.2.7 langchain版本:0.0.338. fastchat版本:0.2.32

当前使用的分词器:ChineseRecursiveTextSplitter 当前启动的LLM模型:['chatglm2-6b', 'zhipu-api', 'openai-api'] @ mps {'device': 'mps', 'host': '0.0.0.0', 'infer_turbo': False, 'model_path': '/Users/xxxx/xxx/projects/chatglm2-6b', 'port': 20002} {'api_key': '', 'device': 'auto', 'host': '0.0.0.0', 'infer_turbo': False, 'online_api': True, 'port': 21001, 'provider': 'ChatGLMWorker', 'version': 'chatglm_turbo', 'worker_class': <class 'server.model_workers.zhipu.ChatGLMWorker'>} {'api_base_url': 'https://api.openai.com/v1', 'api_key': '', 'device': 'auto', 'host': '0.0.0.0', 'infer_turbo': False, 'model_name': 'gpt-35-turbo', 'online_api': True, 'openai_proxy': '', 'port': 20002} 当前Embbedings模型: m3e-base @ mps ==============================Langchain-Chatchat Configuration==============================

2023-11-22 19:28:05,816 - startup.py[line:647] - INFO: 正在启动服务: 2023-11-22 19:28:05,816 - startup.py[line:648] - INFO: 如需查看 llm_api 日志,请前往 /Users/xxxx/xxx/projects/langchain-chatchat/logs 2023-11-22 19:28:08 | INFO | model_worker | Register to controller 2023-11-22 19:28:08 | ERROR | stderr | INFO: Started server process [382] 2023-11-22 19:28:08 | ERROR | stderr | INFO: Waiting for application startup. 2023-11-22 19:28:08 | ERROR | stderr | INFO: Application startup complete. 2023-11-22 19:28:08 | ERROR | stderr | INFO: Uvicorn running on http://0.0.0.0:20000 (Press CTRL+C to quit) 2023-11-22 19:28:09 | INFO | model_worker | Loading the model ['chatglm2-6b'] on worker b83690ab ... Loading checkpoint shards: 0%| | 0/7 [00:00<?, ?it/s] Loading checkpoint shards: 14%|█████▌ | 1/7 [00:01<00:08, 1.39s/it] Loading checkpoint shards: 29%|███████████▏ | 2/7 [00:03<00:08, 1.64s/it] Loading checkpoint shards: 43%|████████████████▋ | 3/7 [00:04<00:05, 1.49s/it] Loading checkpoint shards: 57%|██████████████████████▎ | 4/7 [00:06<00:04, 1.49s/it] Loading checkpoint shards: 71%|███████████████████████████▊ | 5/7 [00:08<00:03, 1.69s/it] Loading checkpoint shards: 86%|█████████████████████████████████▍ | 6/7 [00:11<00:02, 2.20s/it] Loading checkpoint shards: 100%|███████████████████████████████████████| 7/7 [00:12<00:00, 1.81s/it] Loading checkpoint shards: 100%|███████████████████████████████████████| 7/7 [00:12<00:00, 1.76s/it] 2023-11-22 19:28:21 | ERROR | stderr | 2023-11-22 19:29:11 | INFO | model_worker | Register to controller INFO: Started server process [511] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:7861 (Press CTRL+C to quit) Process WEBUI Server: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/xxxx/xxx/projects/langchain-chatchat/startup.py", line 461, in run_webui p = subprocess.Popen(cmd) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'streamlit'`

环境信息 / Environment Information

附加信息 / Additional Information 依赖包信息如下 Package Version


accelerate 0.24.1 aiohttp 3.9.0 aiolimiter 1.1.0 aiosignal 1.3.1 altair 5.1.2 altgraph 0.17.2 antlr4-python3-runtime 4.9.3 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 backoff 2.2.1 bce-python-sdk 0.8.96 beautifulsoup4 4.12.2 blinker 1.7.0 blis 0.7.11 Brotli 1.1.0 cachetools 5.3.2 catalogue 2.0.10 certifi 2023.11.17 cffi 1.16.0 chardet 5.2.0 charset-normalizer 2.0.12 click 8.1.7 cloudpathlib 0.16.0 coloredlogs 15.0.1 confection 0.1.3 contourpy 1.2.0 cryptography 41.0.5 cycler 0.12.1 cymem 2.0.8 dashscope 1.13.3 dataclasses 0.6 dataclasses-json 0.6.2 distro 1.8.0 effdet 0.4.1 einops 0.7.0 emoji 2.8.0 et-xmlfile 1.1.0 exceptiongroup 1.1.3 faiss-cpu 1.7.4 fastapi 0.104.1 filelock 3.13.1 filetype 1.2.0 flatbuffers 23.5.26 fonttools 4.44.3 frozenlist 1.4.0 fschat 0.2.32 fsspec 2023.10.0 future 0.18.2 gitdb 4.0.11 GitPython 3.1.40 h11 0.14.0 h2 4.1.0 hpack 4.0.0 httpcore 1.0.2 httpx 0.25.1 huggingface-hub 0.19.4 humanfriendly 10.0 hyperframe 6.0.1 idna 3.4 importlib-metadata 6.8.0 importlib-resources 6.1.1 iniconfig 2.0.0 iopath 0.1.10 Jinja2 3.1.2 joblib 1.3.2 jsonpatch 1.33 jsonpointer 2.4 jsonschema 4.20.0 jsonschema-specifications 2023.11.1 kiwisolver 1.4.5 langchain 0.0.338 langchain-experimental 0.0.42 langcodes 3.3.0 langdetect 1.0.9 langsmith 0.0.65 layoutparser 0.3.4 lxml 4.9.3 macholib 1.15.2 Markdown 3.5.1 markdown-it-py 3.0.0 markdown2 2.4.10 markdownify 0.11.6 MarkupSafe 2.1.3 marshmallow 3.20.1 matplotlib 3.8.2 mdurl 0.1.2 mpmath 1.3.0 msg-parser 1.2.0 multidict 6.0.4 murmurhash 1.0.10 mypy-extensions 1.0.0 networkx 3.2.1 nh3 0.2.14 nltk 3.8.1 numexpr 2.8.7 numpy 1.24.4 olefile 0.46 omegaconf 2.3.0 onnx 1.15.0 onnxruntime 1.15.1 openai 1.3.3 opencv-python 4.8.1.78 openpyxl 3.1.2 packaging 23.2 pandas 2.0.3 pathlib 1.0.1 pdf2image 1.16.3 pdfminer.six 20221105 pdfplumber 0.10.3 peft 0.6.2 Pillow 9.5.0 pip 23.3.1 pluggy 1.3.0 portalocker 2.8.2 preshed 3.0.9 prompt-toolkit 3.0.41 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyclipper 1.3.0.post5 pycocotools 2.0.7 pycparser 2.21 pycryptodome 3.19.0 pydantic 1.10.13 pydeck 0.8.1b0 Pygments 2.17.1 PyJWT 2.8.0 PyMuPDF 1.23.6 PyMuPDFb 1.23.6 pypandoc 1.12 pyparsing 3.1.1 pypdfium2 4.24.0 pytesseract 0.3.10 pytest 7.4.3 python-dateutil 2.8.2 python-decouple 3.8 python-docx 1.1.0 python-iso639 2023.6.15 python-magic 0.4.27 python-multipart 0.0.6 python-pptx 0.6.23 pytz 2023.3.post1 PyYAML 6.0.1 qianfan 0.1.1 rapidfuzz 3.5.2 rapidocr-onnxruntime 1.3.8 referencing 0.31.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rpds-py 0.13.0 safetensors 0.4.0 scikit-learn 1.3.2 scipy 1.11.4 sentence-transformers 2.2.2 sentencepiece 0.1.99 setuptools 58.0.4 shapely 2.0.2 shortuuid 1.0.11 simplejson 3.19.2 six 1.15.0 smart-open 6.4.0 smmap 5.0.1 sniffio 1.3.0 socksio 1.0.0 soupsieve 2.5 spacy 3.7.2 spacy-legacy 3.0.12 spacy-loggers 1.0.5 SQLAlchemy 2.0.19 srsly 2.4.8 starlette 0.27.0 streamlit 1.27.2 streamlit-aggrid 0.3.4.post3 streamlit-antd-components 0.2.3 streamlit-chatbox 1.1.11 streamlit-feedback 0.1.2 streamlit-option-menu 0.3.6 strsimpy 0.2.1 svgwrite 1.4.3 sympy 1.12 tabulate 0.9.0 tenacity 8.2.3 thinc 8.2.1 threadpoolctl 3.2.0 tiktoken 0.5.1 timm 0.9.10 tokenizers 0.15.0 toml 0.10.2 tomli 2.0.1 toolz 0.12.0 torch 2.1.1 torchaudio 2.1.1 torchvision 0.16.1 tornado 6.3.3 tqdm 4.66.1 transformers 4.35.2 transformers-stream-generator 0.0.4 typer 0.9.0 typing_extensions 4.8.0 typing-inspect 0.9.0 tzdata 2023.3 tzlocal 5.2 unstructured 0.10.30 unstructured-inference 0.7.11 unstructured.pytesseract 0.3.12 urllib3 1.25.11 uvicorn 0.23.2 validators 0.22.0 wasabi 1.1.2 watchdog 3.0.0 wavedrom 2.0.3.post3 wcwidth 0.2.10 weasel 0.3.4 websockets 12.0 wheel 0.37.0 xformers 0.0.22.post7 xlrd 2.0.1 XlsxWriter 3.1.9 yarl 1.9.2 zhipuai 1.0.7 zipp 3.17.0

WangXBruc commented 12 months ago

请求大佬们支援

zRzRzRzRzRzRzR commented 12 months ago

库安装了,但是找不到库?

WangXBruc commented 12 months ago

在mac上,虽然安装了 python 依赖 streamlit,但是 streamlit 命令并没有注册到系统,导致执行 run_webui 出错,解决方案是在~/.zshrc 中添加 export PATH=/Users/{UserName}/Library/Python/3.9/bin:$PATH

yanfei-zhang-95 commented 1 month ago

类似问题,但出现的问题是,在远程机上用python startup.py -a跑没有问题,但到windows本机,用pycharm pro连接ssh跑远程的时候,就会出现这个问题,请问应该怎么解决

yanfei-zhang-95 commented 1 month ago

类似问题,但出现的问题是,在远程机上用python startup.py -a跑没有问题,但到windows本机,用pycharm pro连接ssh跑远程的时候,就会出现这个问题,请问应该怎么解决

解决问题了: https://github.com/chatchat-space/Langchain-Chatchat/issues/2805

0930mcx commented 1 month ago

类似问题,但出现的问题是,在远程机上用python startup.py -a跑没有问题,但到windows本机,用pycharm pro连接ssh跑远程的时候,就会出现这个问题,请问应该怎么解决

解决问题了: #2805

哥请问你是怎么解决的