Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install check for libpython3-dev and build-essential #171

Merged
merged 1 commit into from
May 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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