22set -x -e
33
44apt-get -y -qq update
5- apt-get -y -qq install lsb-core
5+ apt-get -y -qq install lsb-core > /dev/null
66if [[ $( lsb_release -r | awk ' { print $2 }' ) == " 14.04" ]]; then
7- apt-get -y -qq install libav-tools
7+ apt-get -y -qq install libav-tools > /dev/null
88 if [[ ${1} == " 2.7" ]]; then
9- rm -f /usr/local/bin/pip
10- ln -s /usr/local/bin/pip2 /usr/local/bin/pip
11- pip install auditwheel
9+ echo " Python 2.7"
1210 elif [[ ${1} == " 3.4" ]]; then
1311 rm -f /usr/local/bin/pip
14- ln -s /usr/local/bin/pip3 /usr/local/bin/pip
12+ ln -s /usr/local/bin/pip3.4 /usr/local/bin/pip
1513 rm -f /usr/bin/python
16- ln -s /usr/bin/python3 /usr/bin/python
17- pip install auditwheel
14+ ln -s /usr/bin/python3.4 /usr/bin/python
1815 elif [[ ${1} == " 3.5" ]]; then
1916 curl -sOL https://raw.githubusercontent.com/tensorflow/tensorflow/v1.12.0/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
20- chmod +x install_python3.5_pip_packages.sh
2117 sed -i ' s/apt-get update/apt-get -y -qq update/g' install_python3.5_pip_packages.sh
2218 sed -i ' s/apt-get install/apt-get -y -qq install/g' install_python3.5_pip_packages.sh
2319 sed -i ' s/pip3.5 install/pip3.5 -q install/g' install_python3.5_pip_packages.sh
24- ./ install_python3.5_pip_packages.sh
20+ bash install_python3.5_pip_packages.sh
2521 rm -f install_python3.5_pip_packages.sh
2622 rm -f /usr/bin/python
2723 ln -s /usr/bin/python3.5 /usr/bin/python
@@ -30,7 +26,6 @@ if [[ $(lsb_release -r | awk '{ print $2 }') == "14.04" ]]; then
3026 elif [[ ${1} == " 3.6" ]]; then
3127 rm -f /usr/local/bin/pip3
3228 curl -sOL https://raw.githubusercontent.com/tensorflow/tensorflow/v1.12.0/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
33- chmod +x install_python3.6_pip_packages.sh
3429 sed -i ' s/apt-get update/apt-get -y -qq update/g' install_python3.6_pip_packages.sh
3530 sed -i ' s/apt-get install/apt-get -y -qq install/g' install_python3.6_pip_packages.sh
3631 sed -i ' s/apt-get upgrade/apt-get -y -qq upgrade/g' install_python3.6_pip_packages.sh
@@ -39,19 +34,58 @@ if [[ $(lsb_release -r | awk '{ print $2 }') == "14.04" ]]; then
3934 sed -i ' s/configure/configure -q/g' install_python3.6_pip_packages.sh
4035 sed -i ' s/make altinstall/make altinstall>make.log/g' install_python3.6_pip_packages.sh
4136 sed -i ' s/wget /wget -q /g' install_python3.6_pip_packages.sh
42- ./ install_python3.6_pip_packages.sh
37+ bash install_python3.6_pip_packages.sh
4338 rm -f install_python3.6_pip_packages.sh make.log
4439 rm -rf Python-3.6.1*
4540 rm -f /usr/bin/python
4641 ln -s /usr/local/bin/python3.6 /usr/bin/python
4742 rm -f /usr/local/bin/pip
48- ln -s /usr/local/bin/pip3 /usr/local/bin/pip
43+ ln -s /usr/local/bin/pip3.6 /usr/local/bin/pip
4944 else
5045 echo Python ${1} not supported!
5146 exit 1
5247 fi
48+ elif [[ $( lsb_release -r | awk ' { print $2 }' ) == " 16.04" ]]; then
49+ if [[ ${1} == " 2.7" ]]; then
50+ echo " Python 2.7"
51+ apt-get -y -qq install ffmpeg python-pip > /dev/null
52+ pip install -q auditwheel==1.5.0
53+ pip install -q wheel==0.31.1
54+ elif [[ ${1} == " 3.5" ]]; then
55+ echo " Python 3.5"
56+ apt-get -y -qq install ffmpeg python3-pip > /dev/null
57+ pip3 install -q auditwheel==1.5.0
58+ pip3 install -q wheel==0.31.1
59+ rm -f /usr/bin/python
60+ ln -s /usr/bin/python3 /usr/bin/python
61+ rm -f /usr/bin/pip
62+ ln -s /usr/bin/pip3 /usr/bin/pip
63+ else
64+ echo Platform $( lsb_release -r | awk ' { print $2 }' ) not supported!
65+ exit 1
66+ fi
67+ elif [[ $( lsb_release -r | awk ' { print $2 }' ) == " 18.04" ]]; then
68+ if [[ ${1} == " 2.7" ]]; then
69+ echo " Python 2.7"
70+ apt-get -y -qq install ffmpeg python-pip > /dev/null
71+ pip install -q auditwheel==1.5.0
72+ pip install -q wheel==0.31.1
73+ elif [[ ${1} == " 3.6" ]]; then
74+ echo " Python 3.6"
75+ apt-get -y -qq install ffmpeg python3-pip > /dev/null
76+ pip3 install -q auditwheel==1.5.0
77+ pip3 install -q wheel==0.31.1
78+ rm -f /usr/bin/python
79+ ln -s /usr/bin/python3 /usr/bin/python
80+ rm -f /usr/bin/pip
81+ ln -s /usr/bin/pip3 /usr/bin/pip
82+ else
83+ echo Platform $( lsb_release -r | awk ' { print $2 }' ) not supported!
84+ exit 1
85+ fi
5386else
5487 echo Platform $( lsb_release -r | awk ' { print $2 }' ) not supported!
88+ exit 1
5589fi
5690python --version
5791pip --version
0 commit comments