From 7b210c28d9b17760fa76218118b5780667e3322b Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 9 Jun 2021 10:39:24 +0000 Subject: [PATCH] Fix python detection on Debian --- ansible-setup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ansible-setup.sh b/ansible-setup.sh index 68dec30..617bf6d 100755 --- a/ansible-setup.sh +++ b/ansible-setup.sh @@ -38,8 +38,13 @@ else echo "python3 found: $py3cmd" fi -if ! $($py3cmd -c "import venv"); then - echo "Python 3 venv module missing. Try installing python3-venv package." +if ! $($py3cmd -c "import venv" 2> /dev/null); then + echo "Python3 venv module missing. Try installing python3-venv package." + exit 1 +fi + +if ! $($py3cmd -c "import ensurepip" 2> /dev/null); then + echo "Python3 ensurepip module missing. Try installing python3-venv package." exit 1 fi