-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_methods_python.sh
More file actions
68 lines (50 loc) · 1.73 KB
/
bash_methods_python.sh
File metadata and controls
68 lines (50 loc) · 1.73 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
function create_a_new_virutal_env(){
mkvirtualenv --python=$2 $1
}
function python_path(){
PATH="$HOME/.pyenv/versions/$1/bin/python"
echo $PATH
}
function create_a_new_virutal_env_with_python2_7(){
PYTHON_PATH=$(python_path 2.7)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python2_7_9(){
PYTHON_PATH=$(python_path 2.7.9)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python3_5_3(){
PYTHON_PATH=$(python_path 3.5.3)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python3_7_2(){
PYTHON_PATH=$(python_path 3.7.2)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python3_7_3(){
PYTHON_PATH=$(python_path 3.7.3)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python3_8_1(){
PYTHON_PATH=$(python_path 3.8.1)
create_a_new_virutal_env $1 $PYTHON_PATH
}
function create_a_new_virutal_env_with_python(){
PYTHON_PATH=$(python_path $1)
create_a_new_virutal_env $2 $PYTHON_PATH
}
function remove_currently_activated_virtalenv(){
# https://stackoverflow.com/a/37154360/8555105
deactivate
}
function pip_install_for_all_users(){
pip install --user $pip_name
}
function install_pip_under_the_current_virtual_env_python(){
echo "ok, so pip will be installed under the current virtual env and current python version"
curl https://bootstrap.pypa.io/get-pip.py | python
echo "verify the python version that pip was installed on, run: `pip uninstall pip`; and don't confirm!"
}