Home | History | Annotate | Download | only in install
      1 #!/usr/bin/env bash
      2 # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #     http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 # ==============================================================================
     16 # Install packages required by Python3.5 build
     17 
     18 # TODO(cais): Remove this file once we upgrade to ubuntu:16.04 docker images for
     19 # Python 3.5 builds.
     20 
     21 # LINT.IfChange
     22 
     23 # fkrull/deadsnakes is for Python3.5
     24 add-apt-repository -y ppa:fkrull/deadsnakes
     25 apt-get update
     26 
     27 set -e
     28 # Install Python 3.5 and dev library
     29 apt-get install -y --no-install-recommends python3.5 libpython3.5-dev
     30 
     31 # Install pip3.5
     32 set +e
     33 pip35_version=$(pip3.5 --version | grep "python 3.5")
     34 if [[ -z $pip35_version ]]; then
     35   set -e
     36   wget -q https://bootstrap.pypa.io/get-pip.py
     37   python3.5 get-pip.py
     38   rm -f get-pip.py
     39 fi
     40 
     41 set -e
     42 pip3.5 install --upgrade virtualenv
     43 
     44 # Install six.
     45 pip3.5 install --upgrade absl-py
     46 pip3.5 install --upgrade six==1.10.0
     47 
     48 # Install protobuf.
     49 pip3.5 install --upgrade protobuf==3.3.0
     50 
     51 # Remove obsolete version of six, which can sometimes confuse virtualenv.
     52 rm -rf /usr/lib/python3/dist-packages/six*
     53 
     54 # Install numpy, scipy and scikit-learn required by the builds
     55 
     56 # numpy needs to be installed from source to fix segfaults. See:
     57 # https://github.com/tensorflow/tensorflow/issues/6968
     58 # This workaround isn't needed for Ubuntu 16.04 or later.
     59 pip3.5 install --no-binary=:all: --upgrade numpy==1.12.0
     60 
     61 pip3.5 install scipy==0.18.1
     62 
     63 pip3.5 install scikit-learn==0.19.1
     64 
     65 # pandas required by `inflow`
     66 pip3 install pandas==0.19.2
     67 
     68 # Install recent-enough version of wheel for Python 3.5 wheel builds
     69 pip3.5 install wheel==0.29.0
     70 
     71 pip3.5 install portpicker
     72 
     73 pip3.5 install werkzeug
     74 
     75 pip3.5 install grpcio
     76 
     77 # Eager-to-graph execution needs astor, gast and termcolor:
     78 pip3.5 install --upgrade astor
     79 pip3.5 install --upgrade gast
     80 pip3.5 install --upgrade termcolor
     81 
     82 # LINT.ThenChange(//tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh)
     83