1#!/usr/bin/env bash 2# Copyright 2015 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 17set -e 18 19# We don't apt-get install so that we can install a newer version of pip. 20# Only needed for Ubuntu 14.04 and 16.04; not needed for 18.04 and Debian 8,9? 21# Run easy_install after easy_install3, so that the default pip points to pip2, 22# to match the default python version of 2.7. 23easy_install3 -U pip==18.1 24easy_install -U pip==18.1 25 26# Install pip packages from whl files to avoid the time-consuming process of 27# building from source. 28 29# Pin wheel==0.31.1 to work around issue 30# https://github.com/pypa/auditwheel/issues/102 31pip2 install wheel==0.31.1 32pip3 install wheel==0.31.1 33 34# Install last working version of setuptools. This must happen before we install 35# absl-py, which uses install_requires notation introduced in setuptools 20.5. 36pip2 install --upgrade setuptools==39.1.0 37pip3 install --upgrade setuptools==39.1.0 38 39pip2 install virtualenv 40pip3 install virtualenv 41 42# Install six. 43pip2 install --upgrade six==1.12.0 44pip3 install --upgrade six==1.12.0 45 46# Install absl-py. 47pip2 install --upgrade absl-py 48pip3 install --upgrade absl-py 49 50# Install werkzeug. 51pip2 install --upgrade werkzeug==0.11.10 52pip3 install --upgrade werkzeug==0.11.10 53 54# Install bleach. html5lib will be picked up as a dependency. 55pip2 install --upgrade bleach==2.0.0 56pip3 install --upgrade bleach==2.0.0 57 58# Install markdown. 59pip2 install --upgrade markdown==2.6.8 60pip3 install --upgrade markdown==2.6.8 61 62# Install protobuf. 63pip2 install --upgrade protobuf==3.6.1 64pip3 install --upgrade protobuf==3.6.1 65 66# Remove obsolete version of six, which can sometimes confuse virtualenv. 67rm -rf /usr/lib/python3/dist-packages/six* 68 69# numpy needs to be installed from source to fix segfaults. See: 70# https://github.com/tensorflow/tensorflow/issues/6968 71# This workaround isn't needed for Ubuntu 16.04 or later. 72if $(cat /etc/*-release | grep -q 14.04); then 73 pip2 install --no-binary=:all: --upgrade numpy==1.14.5 74 pip3 install --no-binary=:all: --upgrade numpy==1.14.5 75else 76 pip2 install --upgrade numpy==1.14.5 77 pip3 install --upgrade numpy==1.14.5 78fi 79 80pip2 install scipy==1.1.0 81pip3 install scipy==1.1.0 82 83pip2 install scikit-learn==0.18.1 84pip3 install scikit-learn==0.18.1 85 86# pandas required by `inflow` 87pip2 install pandas==0.19.2 88pip3 install pandas==0.19.2 89 90# Benchmark tests require the following: 91pip2 install psutil 92pip3 install psutil 93pip2 install py-cpuinfo 94pip3 install py-cpuinfo 95 96# pylint tests require the following: 97pip2 install pylint==1.6.4 98pip3 install pylint==1.6.4 99 100# pycodestyle tests require the following: 101pip2 install pycodestyle 102pip3 install pycodestyle 103 104# tf.mock require the following for python2: 105pip2 install mock 106 107pip2 install portpicker 108pip3 install portpicker 109 110# TensorFlow Serving integration tests require the following: 111pip2 install grpcio 112pip3 install grpcio 113 114# Eager-to-graph execution needs astor, gast and termcolor: 115pip2 install --upgrade astor 116pip3 install --upgrade astor 117pip2 install --upgrade gast 118pip3 install --upgrade gast 119pip2 install --upgrade termcolor 120pip3 install --upgrade termcolor 121 122# Keras 123pip2 install keras_applications==1.0.6 --no-deps 124pip3 install keras_applications==1.0.6 --no-deps 125pip2 install keras_preprocessing==1.0.5 --no-deps 126pip3 install keras_preprocessing==1.0.5 --no-deps 127pip2 install --upgrade h5py==2.8.0 128pip3 install --upgrade h5py==2.8.0 129 130# Estimator 131pip2 install tf-estimator-nightly==1.12.0.dev20181203 --no-deps 132pip3 install tf-estimator-nightly==1.12.0.dev20181203 --no-deps 133