-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakevenv.sh
More file actions
51 lines (39 loc) · 1.15 KB
/
Copy pathmakevenv.sh
File metadata and controls
51 lines (39 loc) · 1.15 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
PYTHON_V="/usr/bin/python36"
if [[ $1 ]]
then
venv_name=$1
else
read -p "venv name: " venv_name
fi
virtualenv -p ${PYTHON_V} ${venv_name}
read -n 1 -p ">> Install requirements file [y/n]? " install_req_file
echo ""
while [[ ${install_req_file} == "y" ]]
do
read -p ">> Requirements file path: " file_path
echo "Installing requirements from file: ${file_path}"
${venv_name}/bin/pip install -r ${file_path}
read -n 1 -p ">> Install another requirements file [y/n]? " install_req_file
echo ""
done
read -n 1 -p ">> Install libraries [y/n]? " install_lib
echo ""
while [[ ${install_lib} == "y" ]]
do
read -p ">> Please input library, with or without version: " lib_name
echo "Installing library: ${lib_name}
"
${venv_name}/bin/pip install ${lib_name}
read -n 1 -p ">> Install more libraries [y/n]? " install_lib
echo ""
done
read -n 1 -p ">> Print virtual environment libraries (pip freeze) [y/n]? " print_pip_freeze
echo ""
if [[ ${print_pip_freeze} == "y" ]]
then
echo ""
${venv_name}/bin/pip freeze
echo ""
fi
echo "Done! Created virtual environment $venv_name, using python version $PYTHON_V"