From 7845e8c5ec778bd8cac25eccd6661d436a18f1b4 Mon Sep 17 00:00:00 2001 From: chicrobot Date: Tue, 13 Jan 2026 22:13:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20d1=5Fpython=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=85=8D=E7=BD=AE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- d1_python环境配置.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/d1_python环境配置.md b/d1_python环境配置.md index 8a88de9..040e8f1 100644 --- a/d1_python环境配置.md +++ b/d1_python环境配置.md @@ -11,20 +11,34 @@ pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ ``` ## venv创建虚拟环境 +linux ```bash python3 -m venv .venv ``` - +windows +```bash +python -m venv .venv +``` ## 激活虚拟环境 +linux ```bash source .venv/bin/activate ``` +windows +```bash +& .venv/Scripts/Activate.ps1 +``` ## 启动项目 ### 将当前目录为项目 +linux ```bash export PYTHONPATH=$(pwd):$PYTHONPATH ``` +windows +```bash +$env:PYTHONPATH = "$PWD.Path;$env:PYTHONPATH" +``` ### 启动main.py ```bash python main.py