File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ set "PATH=%OPENVINO_LIB_PATHS%;%PATH%"
6767
6868:: Check if Python is installed
6969set PYTHON_VERSION_MAJOR = 3
70- set MIN_REQUIRED_PYTHON_VERSION_MINOR = 9
70+ set MIN_REQUIRED_PYTHON_VERSION_MINOR = 10
7171set MAX_SUPPORTED_PYTHON_VERSION_MINOR = 14
7272
7373python --version 2 > NUL
@@ -94,6 +94,9 @@ for /F "tokens=1,2 delims=. " %%a in ("%python_version%") do (
9494 set pyversion_minor = %%b
9595)
9696
97+ :: Strip non-numeric suffix from minor version (e.g., 14t -> 14)
98+ call :strip_suffix pyversion_minor
99+
97100if %pyversion_major% equ %PYTHON_VERSION_MAJOR% (
98101 if %pyversion_minor% geq %MIN_REQUIRED_PYTHON_VERSION_MINOR% (
99102 if %pyversion_minor% leq %MAX_SUPPORTED_PYTHON_VERSION_MINOR% (
@@ -126,6 +129,16 @@ if not "%bitness%"=="64" (
126129set PYTHONPATH = %INTEL_OPENVINO_DIR% \python;%INTEL_OPENVINO_DIR% \python\python3;%PYTHONPATH%
127130exit /B 0
128131
132+ :strip_suffix
133+ :: Remove non-numeric suffix from a version number variable
134+ :: Usage: call :strip_suffix variable_name
135+ :: Strip 't' suffix (e.g., 14t -> 14)
136+ setlocal enabledelayedexpansion
137+ set " var_value = !%~1! "
138+ for /f " delims=t" %%i in (" !var_value! " ) do set " var_value = %%i "
139+ endlocal & set " %~1 = %var_value% "
140+ exit /B 0
141+
129142:GetFullPath
130143SET %2 =%~f1
131144
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ Write-Host "[setupvars] OpenVINO environment initialized"
6363
6464# Check if Python is installed
6565$PYTHON_VERSION_MAJOR = 3
66- $MIN_REQUIRED_PYTHON_VERSION_MINOR = 9
66+ $MIN_REQUIRED_PYTHON_VERSION_MINOR = 10
6767$MAX_SUPPORTED_PYTHON_VERSION_MINOR = 14
6868
6969try
@@ -86,7 +86,11 @@ if (-not $python_version)
8686}
8787else
8888{
89- [int ]$installed_python_version_major , [int ]$installed_python_version_minor = $python_version.Split (' .' )
89+ $version_parts = $python_version.Split (' .' )
90+ $installed_python_version_major = [int ]$version_parts [0 ]
91+ # Strip non-numeric suffix from minor version (e.g., 14t -> 14)
92+ $minor_version_string = $version_parts [1 ] -replace ' [^0-9].*$' , ' '
93+ $installed_python_version_minor = [int ]$minor_version_string
9094}
9195
9296if (-not ($PYTHON_VERSION_MAJOR -eq $installed_python_version_major -and $installed_python_version_minor -ge $MIN_REQUIRED_PYTHON_VERSION_MINOR -and $installed_python_version_minor -le $MAX_SUPPORTED_PYTHON_VERSION_MINOR ))
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ if command -v lsb_release >/dev/null 2>&1; then
100100fi
101101
102102PYTHON_VERSION_MAJOR=" 3"
103- MIN_REQUIRED_PYTHON_VERSION_MINOR=" 9 "
103+ MIN_REQUIRED_PYTHON_VERSION_MINOR=" 10 "
104104MAX_SUPPORTED_PYTHON_VERSION_MINOR=" 14"
105105
106106check_python_version () {
@@ -113,9 +113,12 @@ check_python_version () {
113113 python_version_minor=$( python3 -c " import sys; print(str(\" ${python_version} \" .split('.')[1]))" )
114114 fi
115115
116+ # Strip non-numeric suffix from minor version (e.g., 14t -> 14)
117+ python_version_minor_numeric=" ${python_version_minor%% [!0-9]* } "
118+
116119 if [ " $PYTHON_VERSION_MAJOR " != " $python_version_major " ] ||
117- [ " $python_version_minor " -lt " $MIN_REQUIRED_PYTHON_VERSION_MINOR " ] ||
118- [ " $python_version_minor " -gt " $MAX_SUPPORTED_PYTHON_VERSION_MINOR " ] ; then
120+ [ " $python_version_minor_numeric " -lt " $MIN_REQUIRED_PYTHON_VERSION_MINOR " ] ||
121+ [ " $python_version_minor_numeric " -gt " $MAX_SUPPORTED_PYTHON_VERSION_MINOR " ] ; then
119122 echo " [setupvars.sh] WARNING: Unsupported Python version ${python_version} . Please install one of Python" \
120123 " ${PYTHON_VERSION_MAJOR} .${MIN_REQUIRED_PYTHON_VERSION_MINOR} -" \
121124 " ${PYTHON_VERSION_MAJOR} .${MAX_SUPPORTED_PYTHON_VERSION_MINOR} (64-bit) from https://www.python.org/downloads/"
You can’t perform that action at this time.
0 commit comments