if 'y' in response.lower():
    pip.main(['uninstall', package])
pass
if __name__ == '__main__':
    uninstall('mypackagename')
input('Press Enter to Exit...\n')
Installing Python packages from local file system folder with pip