I found a PowerShell script in the WPI directory that checked for python installs and I had to delete the registry keys specified in it.
Let me add some context:
Open the below path,
%LOCALAPPDATA%\Microsoft\Web Platform Installer\installers\PythonDetectInstalls
in the sub-folder of the above path, there is a PowerShell script "DetectPythonInstalls.ps1" which contains two script lines for checking if Python is installed:
$regKey = "hklm:SOFTWARE\Python\PythonCore\$pythonVersion\InstallPath";
$correctRegKey = "hklm:SOFTWARE\Wow6432Node\Python\PythonCore\$pythonVersion\InstallPath";
Uninstall all Python versions you do not neet. However, we need to remove some registry keys manually using "regedit".
(Safety Note: Please take a backup of the registry keys before removing the above-mentioned registry key)
Ref: Social.Tecnet