Skip to content

Commit 0953dd5

Browse files
committed
check python version
1 parent 62acb1d commit 0953dd5

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

setup_env.bat

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,21 @@ IF DEFINED PYTHON ECHO Found python here: %PYTHON%
2424
IF NOT DEFINED PYTHON GOTO NO_PYTHON
2525

2626
REM *********************************************************************************
27-
REM Run Pthon script.
27+
REM Check Python version is 2
2828
REM *********************************************************************************
2929
:FOUND_PYTHON
30+
ECHO Checking version of Python...
31+
for /f "tokens=*" %%a in (
32+
'PYTHON --version'
33+
) do (
34+
set PYTHON_VERSION=%%a
35+
)
36+
ECHO Python version = %PYTHON_VERSION%
37+
IF NOT "%PYTHON_VERSION:~0,8%"=="Python 2" GOTO WRONG_PYTHON
38+
39+
REM *********************************************************************************
40+
REM Run Pthon script.
41+
REM *********************************************************************************
3042
ECHO Executing Python setup script...
3143
ECHO.
3244
cd setenv
@@ -41,12 +53,27 @@ REM ****************************************************************************
4153
:NO_PYTHON
4254
ECHO ERROR: The Python executable was not found on your system. Setup failed!
4355
ECHO.
44-
ECHO If Python is already installed somwhere on your system, then you need to add
45-
ECHo the location of python.exe to the Windows PATH environment variable.
46-
ECHO If Python is not installed, then please install Python (verion 2.6 or 2.7).
47-
ECHO If you are not sure how to do this, then google it!
56+
ECHO Python 2.7 is already installed as part of Houdini.
57+
ECHo Please add the folder of python.exe to the Windows PATH environment variable.
58+
ECHO The location should be soometing like this (check your version of Houdini):
59+
ECHO C:\Program Files\Side Effects Software\Houdini 18.0.287\python27
60+
ECHO
61+
ECHO Once Python 2.x is set up, run this setup file again.
62+
ECHO.
63+
GOTO :END
64+
65+
REM *********************************************************************************
66+
REM Python is not version 2.x
67+
REM *********************************************************************************
68+
:WRONG_PYTHON
69+
ECHO ERROR: Python is the wrong version. This installation requires verion 2.x.
4870
ECHO.
49-
ECHO Once Python is set up, run this setup file again.
71+
ECHO Python 2.7 is already installed as part of Houdini.
72+
ECHo Please add the folder of python.exe to the Windows PATH environment variable.
73+
ECHO The location should be soometing like this (check your version of Houdini):
74+
ECHO C:\Program Files\Side Effects Software\Houdini 18.0.287\python27
75+
ECHO
76+
ECHO Once Python 2.x is set up, run this setup file again.
5077
ECHO.
5178
GOTO :END
5279

0 commit comments

Comments
 (0)