From 94aee8ca10ce41ec4d4fb4dcc9d4be24bcfaac8b Mon Sep 17 00:00:00 2001 From: KawaiiYusora Date: Thu, 6 Mar 2025 19:39:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Windows=20=E4=B8=80=E9=94=AE=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_windows.bat | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 run_windows.bat diff --git a/run_windows.bat b/run_windows.bat new file mode 100644 index 000000000..456c04d17 --- /dev/null +++ b/run_windows.bat @@ -0,0 +1,62 @@ +@echo off +setlocal enabledelayedexpansion +chcp 65001 + +REM 修正路径获取逻辑 +cd /d "%~dp0" || ( + echo 错误:切换目录失败 + exit /b 1 +) + +if not exist "venv\" ( + echo 正在初始化虚拟环境... + + where python >nul 2>&1 + if %errorlevel% neq 0 ( + echo 未找到Python解释器 + exit /b 1 + ) + + for /f "tokens=2" %%a in ('python --version 2^>^&1') do set version=%%a + for /f "tokens=1,2 delims=." %%b in ("!version!") do ( + set major=%%b + set minor=%%c + ) + + if !major! equ 3 if !minor! lss 9 ( + echo 需要Python大于等于3.9,当前版本 !version! + exit /b 1 + ) + + echo 正在安装virtualenv... + python -m pip install virtualenv || ( + echo virtualenv安装失败 + exit /b 1 + ) + + echo 正在创建虚拟环境... + python -m virtualenv venv || ( + echo 虚拟环境创建失败 + exit /b 1 + ) + + call venv\Scripts\activate.bat + + echo 正在安装依赖... + pip install -r requirements.txt +) else ( + call venv\Scripts\activate.bat +) + +echo 当前代理设置: +echo HTTP_PROXY=%HTTP_PROXY% +echo HTTPS_PROXY=%HTTPS_PROXY% + +set HTTP_PROXY= +set HTTPS_PROXY= +echo 代理已取消。 + +set no_proxy=0.0.0.0/32 + +call nb run +paus \ No newline at end of file From f7a985b653e2eb5eb823fab003c1e0101c22e0be Mon Sep 17 00:00:00 2001 From: KawaiiYusora Date: Thu, 6 Mar 2025 19:39:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0requirement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | Bin 582 -> 618 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements.txt b/requirements.txt index 49c102dc6efb27b36fc505008b796a8be2539c31..1d268ffa6fbac31fa5297f8de1b5254d33d41235 100644 GIT binary patch delta 62 zcmX@c@``1H36ohdLmopuLphMlVJKkWW#D2+0rE>2Qh_36V16->UBXZblq~_u Date: Thu, 6 Mar 2025 19:43:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E8=A1=A5=E4=BD=8E=E4=BA=8E?= =?UTF-8?q?python3=E4=BC=9A=E9=94=99=E8=AF=AF=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_windows.bat | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/run_windows.bat b/run_windows.bat index 456c04d17..920069318 100644 --- a/run_windows.bat +++ b/run_windows.bat @@ -23,6 +23,11 @@ if not exist "venv\" ( set minor=%%c ) + if !major! lss 3 ( + echo 需要Python大于等于3.0,当前版本 !version! + exit /b 1 + ) + if !major! equ 3 if !minor! lss 9 ( echo 需要Python大于等于3.9,当前版本 !version! exit /b 1 @@ -59,4 +64,4 @@ echo 代理已取消。 set no_proxy=0.0.0.0/32 call nb run -paus \ No newline at end of file +pause \ No newline at end of file