-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·29 lines (24 loc) · 840 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·29 lines (24 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Check if a Python executable is present.
if command -v python3 &>/dev/null; then
python_cmd=python3
elif command -v python &>/dev/null; then
python_cmd=python
else
echo "Python is not installed."
exit 1
fi
# Get the version string.
python_version=$($python_cmd --version 2>&1 | awk '{print $2}')
# Extract the major and minor version numbers (i.e. 3 and 6 from 3.6.x)
major_version=$(echo $python_version | cut -d. -f1)
minor_version=$(echo $python_version | cut -d. -f2)
# Check if the major version number is 3 and the minor version number is 6 or greater
if [ "$major_version" == "3" ] && [ "$minor_version" -ge "6" ]; then
echo "Python >= 3.6 is installed."
else
echo "Python >= 3.6 is not installed."
exit 1
fi
# Execute the installation
$python_cmd -m pip install -U -r requirements.txt