Add the --yes or -y flag to your pip uninstallcommand. This tells pip to assume "yes" to all prompts, skipping the need for user input.
--yes
-y
pip uninstall
pip
%sh pip uninstall databricks-dlt --yes