Commit b1226961 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

ENH: warn user using python.X with X!=5

parent 44e4642f
......@@ -37,10 +37,12 @@ if [ ! -f "$OTB_PYTHON_EXE" ] ; then
fi
fi
python_major_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[0])")
python_minor_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[1])")
python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2])")
python_version="$python_major_version.$python_minor_version.$python_patch_version"
python_version_check() {
python_major_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[0])")
python_minor_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[1])")
python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2])")
python_version="$python_major_version.$python_minor_version.$python_patch_version"
}
python_check_failed() {
printf %s\\n "*****Error occurred during installation******"
......@@ -52,7 +54,22 @@ python_check_failed() {
}
# Do we need the exact version of python?
if [ "$python_major_version" -lt 3 ]; then
python_check_failed
OTB_PYTHON_EXE=$(which python3)
if [! -f "$OTB_PYTHON_EXE"] ; then
python_check_failed
else
python_version_check()
if [ "$python_major_version" -lt 3 ]; then
python_check_failed
fi
fi
fi
# test for 3.5 only ! and warn user if not!
if [ "$python_major_version" -eq 5 ]; then
printf %s\\n "*****Warning******"
printf %s\\n "OTB python bindings require python3.5 but current detected python version is $python_version"
printf %s\\n "This case is undefined!"
fi
python_INSTSONAME=$($OTB_PYTHON_EXE -c "import sys; from distutils import sysconfig; print (sysconfig.get_config_var('INSTSONAME'));")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment