Skip to content

Commit

Permalink
Add install check for libpython3-dev and build-essential (martomi#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterhelsen authored May 23, 2021
1 parent 7cc8a90 commit 2105440
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Function that checks if a package is installed locally
function package_installed() {
return dpkg -l "$1" &> /dev/null
}

# Check Python version
if ! python3 -c 'import sys; assert sys.version_info >= (3,7)' 2> /dev/null;
then
Expand All @@ -6,6 +11,12 @@ then
exit 1
fi

# Check existence of required python build packages
if ! package_installed libpython3-dev || ! package_installed build-essential; then
sudo apt-get update
sudo apt-get install libpython3-dev build-essential -y
fi

# Create virtual environment
python3 -m venv venv

Expand Down

0 comments on commit 2105440

Please sign in to comment.