langchain下载以及相关的一些包的下载

首先下载一个3.12的python环境。

然后开始配置环境

下载langchain本身

pip install langchain -i https://mirrors.aliyun.com/pypi/simple/

下载openai的专用组件

pip install langchain-openai openai -i https://mirrors.aliyun.com/pypi/simple/

下载其他的一些东西

pip install python-dotenv langchain-core -i https://mirrors.aliyun.com/pypi/simple/

后面一些东西

pip install langchain_community -i https://mirrors.aliyun.com/pypi/simple/

后面可以上官网去选择我们需要下载的专有模型的专有的package:

https://docs.langchain.com/oss/python/langchain/models#parameters

下面这个是初始化的本地ollama模型的代码

python 复制代码
from langchain_ollama import ChatOllama

# 设置本地模型,不使用深度思考
model = ChatOllama(base_url="http://localhost:11434", model="modelscope.cn/qwen/Qwen3-0.6B-GGUF:latest", reasoning=False)
# 打印结果,
print(model.invoke("什么是LangChain,1000字回答我"))
相关推荐
东东吖30 分钟前
11-MCP 与 Skills
langchain
东东吖33 分钟前
09-LangChain 上下文与记忆
langchain
东东吖34 分钟前
08-LangChain 中间件
langchain·llm·agent
东东吖37 分钟前
10-RAG(检索增强生成)
langchain
小盆女神节奶粉5 小时前
01-搭建地基
langchain·agent
hryou092217 小时前
做AI-Agent总查不准还运维崩溃2026向量数据库避坑指南
langchain·ai编程·aiops
富贵儿9983 天前
NL2SQL 实践手记 04:多表查询为什么更难——让模型找对表、连对关系
数据库·sql·ai·自然语言处理·langchain
budingxiaomoli3 天前
LangChain与LangGraph介绍
人工智能·langchain
tong_li4 天前
给娃做个 AI 陪写作业助手:LangChain4j 入门(九):AI 分得清老大和老二(多用户隔离与 token 认证)
后端·langchain
东东吖5 天前
07-LangChain Agent智能助手构建笔记
langchain·llm·agent