From 86be7d2c53af4eb0cbc219251e50d4ef723823f1 Mon Sep 17 00:00:00 2001 From: AaronXu <718827633@qq.com> Date: Sat, 11 Jul 2026 11:24:03 +0800 Subject: [PATCH] =?UTF-8?q?07-11-=E5=91=A8=E5=85=AD=5F11-24-03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02_Python环境配置.ipynb | 18 ++++++++++++++++++ 04_LangChain概述.ipynb | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/02_Python环境配置.ipynb b/02_Python环境配置.ipynb index 828ca59..7da4566 100644 --- a/02_Python环境配置.ipynb +++ b/02_Python环境配置.ipynb @@ -170,6 +170,24 @@ "\n", "```powershell\n", "pip install jupyter ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple\n", + "```\n", + "\n", + "在Docker中安装\n", + "\n", + "```bash\n", + "cd /opt\n", + "mkdir jupyter\n", + "cd jupyter\n", + "docker run -p 8888:8888 \\\n", + " -v \"$PWD\":/home/jovyan/work \\\n", + " --name my-jupyter \\\n", + " jupyter/scipy-notebook:latest\n", + "```\n", + "\n", + "在Docker中为jupyter安装汉化包\n", + "\n", + "```bash\n", + "docker exec -it my-jupyter pip install jupyterlab-language-pack-zh-CN -i https://pypi.tuna.tsinghua.edu.cn/simple\n", "```" ] }, diff --git a/04_LangChain概述.ipynb b/04_LangChain概述.ipynb index bcc29d4..4497a55 100644 --- a/04_LangChain概述.ipynb +++ b/04_LangChain概述.ipynb @@ -133,7 +133,9 @@ "source": [ "from langchain_openai import ChatOpenAI\n", "from langchain_core.prompts import ChatPromptTemplate\n", - "import os\n", + "from dotenv import load_dotenv\n", + "\n", + "_=load_dotenv()\n", "\n", "# 1. 创建模型(自动读取环境变量 OPENAI_BASE_URL 和 OPENAI_API_KEY)\n", "llm = ChatOpenAI(\n",