Python package upgrade from 2.7 to 3.6 failed with error "Build dependency: Please install Python >= 3.6"

I am trying to upgrade the python from version 2.7 to 3.6 in my openwrt project. I changed the prereq-build.mk folder accordingly. But, facing the build dependency error. Should i take care of anything else other than the following changes?

Error:

Checking 'md5sum'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python'... failed.
Checking 'python3'... failed.
Checking 'svn'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.

Build dependency: Please install Python >= 3.6
Build dependency: Please install Python >= 3.6

Prerequisite check failed. Use FORCE=1 to override.
make-3.81[1]: *** [staging_dir/host/.prereq-build] Error 1

Changes:

diff --git a/include/prereq-build.mkb/include/prereq-build.mk index 1c872d55..47fb692d 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk @@ -136,10 +136,19 @@ $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5"))
-$(eval $(call SetupHostCommand,python,Please install Python 2.x, \
- python2.7 -V 2>&1 | grep Python, \
- python2 -V 2>&1 | grep Python, \
- python -V 2>&1 | grep Python))
+$(eval $(call SetupHostCommand,python,Please install Python >= 3.6, \
+ python3.8 -V 2>&1 | grep 'Python 3', \
+ python3.7 -V 2>&1 | grep 'Python 3', \
+ python3.6 -V 2>&1 | grep 'Python 3', \
+ python3 -V 2>&1 | grep -E 'Python 3\.[6-8]\.?'))
+
+$(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \
+ python3.8 -V 2>&1 | grep 'Python 3', \
+ python3.7 -V 2>&1 | grep 'Python 3', \
+ python3.6 -V 2>&1 | grep 'Python 3', \
+ python3 -V 2>&1 | grep -E 'Python 3\.[6-8]\.?'))

Am i missing something? Or should i add any other changes to upgrade?

Thanks in advance!