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.7k stars 5.53k forks source link

python3.8下安装numexpr>=2.8.7时出错 #2503

Closed dbtzy closed 9 months ago

dbtzy commented 9 months ago

在python3.8.18下执行pip install -r requirements.txt时提示numexpr最高只有2.8.6

ERROR: Ignored the following yanked versions: 2.6.6.dev0
ERROR: Ignored the following versions that require a different python version: 2.8.7 Requires-Python >=3.9; 2.8.8 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement numexpr>=2.8.7 (from versions: 1.1.1, 1.3, 1.3.1, 1.4, 1.4.1, 1.4.2, 2.0.1, 2.1, 2.2.1, 2.2.2, 2.3rc1, 2.3, 2.3.1, 2.4rc1, 2.4rc2, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5, 2.5.1, 2.5.2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.8.0, 2.8.1, 2.8.3, 2.8.4, 2.8.5, 2.8.6)
ERROR: No matching distribution found for numexpr>=2.8.7
dosubot[bot] commented 9 months ago

🤖

你好,@dbtzy!我是Dosu,一个帮助您解决bug,回答问题,甚至成为贡献者的机器人。在等待人类维护者的过程中,我在这里为您提供帮助。很高兴在此与您相遇!

根据我在Langchain-Chatchat存储库中找到的信息,您遇到的问题可能是因为您尝试安装的numexpr版本不存在。目前可用的最新版本是2.8.6。

要解决此问题,您应该在requirements.txt文件中将numexpr的版本更改为可用的版本。在这种情况下,您应该将numexpr>=2.8.7更改为numexpr>=2.8.6或者只是numexpr==2.8.6,如果您想坚持使用该特定版本。

这是您更新后的requirements.txt文件应该如何看起来:

# API requirements

langchain==0.0.344
langchain-experimental>=0.0.42
pydantic==1.10.13
fschat>=0.2.33
xformers>=0.0.22.post7
openai>=1.3.6
sentence_transformers
transformers>=4.35.2
torch==2.1.0  ##on Windows system, install the cuda version manually from https://pytorch.org/
torchvision  #on Windows system, install the cuda version manually from https://pytorch.org/
torchaudio  #on Windows system, install the cuda version manually from https://pytorch.org/
fastapi>=0.104
nltk>=3.8.1
uvicorn>=0.24.0.post1
starlette~=0.27.0
unstructured[all-docs]==0.11.0
python-magic-bin; sys_platform == 'win32'
SQLAlchemy==2.0.19
faiss-cpu
accelerate>=0.24.1
spacy>=3.7.2
PyMuPDF
rapidocr_onnxruntime
requests>=2.31.0
pathlib>=1.0.1
pytest>=7.4.3
numexpr==2.8.6
strsimpy>=0.2.1
markdownify>=0.11.6
tiktoken>=0.5.1
tqdm>=4.66.1
websockets
numpy~=1.24.4
pandas~=2.0.3
einops>=0.7.0
transformers_stream_generator==0.0.4
vllm==0.2.2; sys_platform == "linux"

# Online api libs dependencies

# zhipuai>=1.0.7
# dashscope>=1.10.0
# qianfan>=0.2.0
# volcengine>=1.0.106
# pymilvus>=2.3.3
# psycopg2
# pgvector>=0.2.4

# Agent and Search Tools

arxiv>=2.0.0
youtube-search>=2.1.2
duckduckgo-search>=3.9.9
metaphor-python>=0.1.23

# WebUI requirements

streamlit>=1.29.0
streamlit-option-menu>=0.3.6
streamlit-antd-components>=0.2.3
streamlit-chatbox>=1.1.11
streamlit-modal>=0.1.0
streamlit-aggrid>=0.3.4.post3
httpx[brotli,http2,socks]>=0.25.2
watchdog>=3.0.0

做出这个更改后,您应该能够无任何问题地安装包。

关于numexpr在Langchain-Chatchat代码库中的具体作用,它被用于评估数学表达式。在calculate函数中,它被用于执行query字符串中提供的数学表达式。这个评估的结果然后作为数学问题的答案返回。

这是相关的代码片段:

...numexpr.evaluate(query)...

这行代码被用来评估query字符串中包含的数学表达式。例如,如果query"37593 * 67"numexpr.evaluate(query)将返回2518731。同样,如果query"37593**(1/5)"numexpr.evaluate(query)将返回8.222831614237718

参考资料:

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

liunux4odoo commented 9 months ago

感谢反馈,下个版本将会把 numexpr 限定为 2.8.6 版。

当前您可以手动安装该版本