generated from dataset-ninja/dataset-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_venv.sh
28 lines (23 loc) · 845 Bytes
/
create_venv.sh
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
#!/bin/bash
# Checking if .venv dir already exists.
if [ -d ".venv" ]; then
echo "VENV dir (.venv) already exists, it will be removed."
rm -rf .venv
fi
echo "VENV will be created"
# Checking if python3.8 is available in PATH.
if command -v python3.8 &>/dev/null; then
python_executable="python3.8" && \
echo "Python 3.8 found, it will be used for creating VENV dir."
else
python_executable="python3" && \
echo "Python 3.8 not found, default python3 will be used for creating VENV dir."
fi
# Creating VENV dir with selected python executable.
$python_executable -m venv .venv && \
source .venv/bin/activate && \
# Installing requirements from requirements.txt.
echo "Install requirements..." && \
pip3 install -r requirements.txt && \
echo "Requirements have been successfully installed, VENV ready." && \
deactivate