File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828
2929# Prevents the PYTHONHOME error from happening and isolate possible python repacks present
3030# in the system and interfeering with runkratos
31- export PYTHONHOME=" "
3231export PYTHONPATH=$kratos_bin_path :$PYTHONPATH
3332
33+
34+ export PATH=$kratos_bin_path \l ibs; $PATH
35+ export PYTHONHOME=$python_home
36+
3437KERNEL_NAME=" linux"
3538
3639
Original file line number Diff line number Diff line change @@ -20,17 +20,9 @@ DEL "%2\vtk_output"
2020
2121@ REM echo "Launching on Compiled for windows -> %kratos_bin_path%" > .run
2222
23-
24- set PATH = E:\Deploy_Deltares\libs;%PATH%
25- set PYTHONPATH = E:\Deploy_Deltares
26- set PYTHONHOME = C:\Users\garat\AppData\Local\Programs\Python\Python311
27-
28-
2923set PATH = %kratos_bin_path% \libs;%PATH%
3024set PYTHONPATH = %kratos_bin_path%
31- REM pythonhome is the parent directory of %python_path %
25+ set PYTHONHOME = %python_home %
3226
33- set PYTHONHOME = " "
34- %python_path% -c " import os; print (os.environ)" > " %2 \\%1 .1info" 2 > " %2 \\%1 .1err"
3527REM Run Python using the script MainKratos.py
3628%python_path% MainKratos.py > " %2 \\%1 .info" 2 > " %2 \\%1 .err"
Original file line number Diff line number Diff line change @@ -9,5 +9,8 @@ rm -f "$2/$1.info"
99rm -f " $2 /$1 .err"
1010rm -f " $2 /$1 .flavia.dat"
1111
12+ export PYTHONPATH=%python_home%
13+ export PYTHONHOME=%python_home%
14+
1215# Run Python using the script MainKratos.py
13- $kratos_python_exe MainKratos.py > " $2 /$1 .info" 2> " $2 /$1 .err"
16+ $python_home /python3 MainKratos.py > " $2 /$1 .info" 2> " $2 /$1 .err"
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ DEL "%2\%1.err"
1313DEL " %2 \%1 *.post.bin"
1414DEL " %2 \%1 *.post.res"
1515DEL " %2 \%1 *.post.msh"
16- @ REM Calculate!
1716
18- set PYTHONHOME = " "
19- %python_path% MainKratos.py > " %2 \\%1 .info" 2 > " %2 \\%1 .err"
17+ set PYTHONPATH = %python_home%
18+ set PYTHONHOME = %python_home%
19+
20+ @ REM Calculate!
21+ %python_home% /python.exe MainKratos.py > " %2 \\%1 .info" 2 > " %2 \\%1 .err"
Original file line number Diff line number Diff line change @@ -78,11 +78,12 @@ proc Kratos::pipVersion { {pythonExecutable ""} } {
7878 }
7979 set ver 0
8080
81+ catch {
8182 set info [exec $pip -m pip --version 2>@1]
8283 if {[regexp {pip\s+(\d+\.\d+)} $info --> version]} {
8384 set ver $version
8485 }
85-
86+ }
8687
8788 return $ver
8889}
@@ -205,7 +206,7 @@ proc Kratos::CheckDependenciesPipMode {} {
205206 if {$py_version <= 0} {
206207 set ret " MISSING_PYTHON"
207208 } else {
208- set pip_version [Kratos::pipVersion $python_exe_path ]
209+ set pip_version [Kratos::pipVersion]
209210 if {$pip_version <= 0} {
210211 set ret " MISSING_PIP"
211212 } else {
@@ -292,11 +293,13 @@ proc Kratos::ExecuteLaunchByMode {launch_mode} {
292293 set python_path [Kratos::ManagePreferences GetValue python_path]
293294 set ::env(python_path) $python_path
294295 set kratos_bin_path [Kratos::ManagePreferences GetValue kratos_bin_path]
296+ set ::env(python_home) [file dirname $python_path ]
295297 set ::env(kratos_bin_path) $kratos_bin_path
296298 }
297299 {External python} {
298300 set python_path [Kratos::ManagePreferences GetValue python_path]
299301 set ::env(python_path) $python_path
302+ set ::env(python_home) [file dirname $python_path ]
300303 }
301304 Default {
302305 set python_path [GiD_Python_GetPythonExe]
@@ -359,4 +362,4 @@ proc Kratos::CreateModeCombo { } {
359362
360363 grid $w -col 9 -row 0 -padx 10 -sticky news
361364
362- }
365+ }
You can’t perform that action at this time.
0 commit comments