-
Notifications
You must be signed in to change notification settings - Fork 57
/
python.sh
executable file
·59 lines (49 loc) · 1.3 KB
/
python.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# source: https://gist.github.com/phatblat/1713458
# Save script's current directory
DIR=$(pwd)
# /bin/bash
set -e
set -u
set -x
OS=`uname`
case $OS in
'Linux')
OS='Linux'
. /etc/lsb-release # get ubuntu version number
# only install
if [ "${DISTRIB_ID}" = "Ubuntu" ]; then
# install ubuntu python package
sudo apt-get install -y python-setuptools python-dev python3-dev build-essential
./pip.sh
# workaround for pip 8.1.2 failing to upgrade on Ubuntu 16.04
# see https://github.com/pypa/pip/issues/3776
# curl -o $HOME/Downloads/get-pip.py https://bootstrap.pypa.io/get-pip.py
# sudo python3 $HOME/Downloads/get-pip.py --user
# commented below until workaround is no longer needed
# python 2
# TODO(ahundt) this may be interfering with python3's pip3?
#sudo easy_install pip
#pip install --upgrade virtualenv
# python 3
# pip3 install --upgrade virtualenv
fi
;;
'FreeBSD')
OS='FreeBSD'
alias ls='ls -G'
;;
'WindowsNT')
OS='Windows'
;;
'Darwin')
OS='Mac'
brew install python python3
;;
'SunOS')
OS='Solaris'
;;
'AIX') ;;
*) ;;
esac
cd $DIR