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
31.83k stars 5.55k forks source link

No module named 'zhipuai' #1403

Closed tendrillion closed 1 year ago

tendrillion commented 1 year ago

问题描述 / Problem Description 参见 开发环境准备,完成环境搭建,确保已经安装了zhipuai。 新建py文件,import zhipuai,一切正常。 运行:python server/llm_api.py,也是执行了import zhipuai,一切正常。

但是运行:python startup.py -a 或者 streamlit run webui.py 报错:No module named 'zhipuai'

项目版本:v0.2.3

==============================Langchain-Chatchat Configuration============================== Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False. You can now view your Streamlit app in your browser. URL: http://0.0.0.0:8501

2023-09-07 16:15:39.891 Uncaught app exception Traceback (most recent call last): File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script exec(code, module.dict) File "/home/user/kylin/Langchain-Chatchat/webui.py", line 8, in from webui_pages.utils import File "/home/user/kylin/Langchain-Chatchat/webui_pages/init.py", line 1, in from .dialogue import dialogue_page, chat_box File "/home/user/kylin/Langchain-Chatchat/webui_pages/dialogue/init.py", line 1, in from .dialogue import dialogue_page, chat_box File "/home/user/kylin/Langchain-Chatchat/webui_pages/dialogue/dialogue.py", line 3, in from webui_pages.utils import File "/home/user/kylin/Langchain-Chatchat/webui_pages/utils.py", line 19, in from server.chat.openai_chat import OpenAiChatMsgIn File "/home/user/kylin/Langchain-Chatchat/server/chat/init.py", line 2, in from .knowledge_base_chat import knowledge_base_chat File "/home/user/kylin/Langchain-Chatchat/server/chat/knowledge_base_chat.py", line 6, in from server.utils import BaseResponse File "/home/user/kylin/Langchain-Chatchat/server/utils.py", line 10, in from server import model_workers File "/home/user/kylin/Langchain-Chatchat/server/model_workers/init.py", line 1, in from .zhipu import ChatGLMWorker File "/home/user/kylin/Langchain-Chatchat/server/model_workers/zhipu.py", line 2, in import zhipuai ModuleNotFoundError: No module named 'zhipuai'

Kun1605 commented 1 year ago

pip install zhipuai

roki1031 commented 1 year ago

找到这个文件直接注释掉第一行即可

tendrillion commented 1 year ago

pip install zhipuai

已经安装了,但是仍然报这个错。

imClumsyPanda commented 1 year ago

请确定python和streamlit命令所使用的python是否与您已安装zhipuai python包的环境一致。

tendrillion commented 1 year ago

请确定python和streamlit命令所使用的python是否与您已安装zhipuai python包的环境一致。

确实是环境的问题。

doublejingheng commented 8 months ago

同求具体解决方法

gocpplua commented 2 weeks ago

查看Python SDK 支持的 python3版本,如:zhipuai 2.1.5.20230904 Python版本支持 正式的 Python (3.8, 3.9, 3.10, 3.11, 3.12)