-
Notifications
You must be signed in to change notification settings - Fork 1
/
env_setup.sh
41 lines (31 loc) · 962 Bytes
/
env_setup.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
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "Removing existing environment/ directory..."
rm -r environment
echo "Creating new environment at environment/ ..."
python3 -m venv environment/
if [[ "$OSTYPE" == "msys"* ]]
then
ENVPATH="environment/Scripts/activate"
elif [[ "$OSTYPE" == "cygwin"* ]]
then
ENVPATH="environment/Scripts/activate"
COMMENT_SYNTAX="rem"
elif [[ "$OSTYPE" == "win32"* ]]
then
ENVPATH="environment/Scripts/activate"
else
ENVPATH="environment/bin/activate"
fi
echo "Installing python packages to environment at $ENVPATH ..."
source $ENVPATH
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
deactivate
echo "Creating activate.sh..."
touch activate.sh
echo > activate.sh
echo "# Created by env_setup.sh, modify the environment variables below if needed.">>activate.sh
echo "source $ENVPATH">> activate.sh
echo >> activate.sh
echo 'Finished setting up environment.'
echo 'To activate environment, run `source activate.sh`.'