From 052c53c27956251e4b4952cd862596a9c08584e4 Mon Sep 17 00:00:00 2001 From: Billy Lamberta Date: Tue, 24 Apr 2018 11:09:09 -0700 Subject: [PATCH] Review fixes to install_linux --- tensorflow/docs_src/install/install_linux.md | 119 +++++++++++++++++++-------- 1 file changed, 84 insertions(+), 35 deletions(-) diff --git a/tensorflow/docs_src/install/install_linux.md b/tensorflow/docs_src/install/install_linux.md index 9b431e4..fa82ac9 100644 --- a/tensorflow/docs_src/install/install_linux.md +++ b/tensorflow/docs_src/install/install_linux.md @@ -116,23 +116,47 @@ There are a few options to install TensorFlow on your machine: ### Use `pip` in a virtual environment -This is the *recommended* install method. The -[Virtualenv](https://virtualenv.pypa.io/en/stable/) tool creates virtual Python -environments that are isolated from other Python development on the same machine. -In this scenario, you install TensorFlow and its dependencies within a virtual -environment that is available when *activated*. Virtualenv provides a reliable -way to install and run TensorFlow while avoiding conflicts with the rest of the -system. +Key Point: Using a virtual environment is the recommended install method. -1\. On Ubuntu, install the `pip` and `virtualenv` packages: +The [Virtualenv](https://virtualenv.pypa.io/en/stable/) tool creates virtual +Python environments that are isolated from other Python development on the same +machine. In this scenario, you install TensorFlow and its dependencies within a +virtual environment that is available when *activated*. Virtualenv provides a +reliable way to install and run TensorFlow while avoiding conflicts with the rest +of the system. + +##### 1. Install Python, `pip`, and `virtualenv`. + +On Ubuntu, Python is automatically installed and `pip` is *usually* installed. +Confirm the `python` and `pip` versions: + +
+  python -V
+  pip -V  # or: pip3 -V
+
+ +To install these packages on Ubuntu:
   sudo apt-get install python-pip python-dev python-virtualenv   # for Python 2.7
   sudo apt-get install python3-pip python3-dev python-virtualenv # for Python 3.n
 
-2\. Create a directory for the virtual environment and choose a Python -interpreter: +We *recommend* using `pip` version 8.1 or higher. If using a release before +version 8.1, upgrade `pip`: + +
+  sudo pip install -U pip
+
+ +If not using Ubuntu and [setuptools](https://pypi.org/project/setuptools/) is +installed, use `easy_install` to install `pip`: + +
+  easy_install -U pip
+
+ +##### 2. Create a directory for the virtual environment and choose a Python interpreter.
   mkdir ~/tensorflow  # somewhere to work out of
@@ -142,7 +166,9 @@ interpreter:
   virtualenv --system-site-packages -p python3 venv # Use Python 3.n
 
-3\. Activate the Virtualenv environment using one of these shell commands: +##### 3. Activate the Virtualenv environment. + +Use one of these shell-specific commands to activate the virtual environment:
   source ~/tensorflow/venv/bin/activate      # bash, sh, ksh, or zsh
@@ -152,26 +178,32 @@ interpreter:
 
 When the Virtualenv is activated, the shell prompt displays as `(venv) $`.
 
-4\. Upgrade `pip` in your virtual environment:
+##### 4. Upgrade `pip` in the virtual environment.
 
-See the [pip installation guide](https://pip.pypa.io/en/stable/installing/) for
-instructions, or use `easy_install`:
+Within the active virtual environment, upgrade `pip`:
 
 
-(venv)$ easy_install -U pip
+(venv)$ pip install -U pip
 
-5\. Within an active Virtualenv environment, use one of the following `pip` -commands to install the TensorFlow package: +You can install other Python packages within the virtual environment without +affecting packages outside the `virtualenv`. + +##### 5. Install TensorFlow in the virtual environment. + +Choose one of the available TensorFlow packages for installation: + +* `tensorflow` —Current release for CPU +* `tensorflow-gpu` —Current release with GPU support +* `tf-nightly` —Nightly build for CPU +* `tf-nightly-gpu` —Nightly build with GPU support + +Within an active Virtualenv environment, use `pip` to install the package:
-(venv)$ pip install --upgrade tensorflow      # for Python 2.7
-(venv)$ pip3 install --upgrade tensorflow     # for Python 3.n
-(venv)$ pip install --upgrade tensorflow-gpu  # for Python 2.7 and GPU
+  pip install -U tensorflow
 
-Success! TensorFlow is now installed. - Use `pip list` to show the packages installed in the virtual environment. [Validate the install](#ValidateYourInstallation) and test the version: @@ -179,6 +211,8 @@ Use `pip list` to show the packages installed in the virtual environment. (venv)$ python -c "import tensorflow as tf; print(tf.__version__)"
+Success: TensorFlow is now installed. + Use the `deactivate` command to stop the Python virtual environment. #### Problems @@ -222,10 +256,9 @@ environment, a system `pip` install is straightforward. See the [REQUIRED_PACKAGES section of setup.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py) -for a list of TensorFlow packages that `pip` installs or upgrade`. +for a list of packages that TensorFlow installs. - -#### Install Python and `pip` +##### 1. Install Python, `pip`, and `virtualenv`. On Ubuntu, Python is automatically installed and `pip` is *usually* installed. Confirm the `python` and `pip` versions: @@ -235,28 +268,42 @@ Confirm the `python` and `pip` versions: pip -V # or: pip3 -V -We *strongly recommend* `pip` or `pip3` version 8.1 or higher. If using a release -before version 8.1, upgrade `pip`: +To install these packages on Ubuntu:
   sudo apt-get install python-pip python-dev   # for Python 2.7
   sudo apt-get install python3-pip python3-dev # for Python 3.n
 
+We *recommend* using `pip` version 8.1 or higher. If using a release before +version 8.1, upgrade `pip`: -#### Install TensorFlow +
+  sudo pip install -U pip
+
-Install one of the available TensorFlow packages: +If not using Ubuntu and [setuptools](https://pypi.org/project/setuptools/) is +installed, use `easy_install` to install `pip`:
-  # Select one:
-  sudo pip install tensorflow      # Python 2.7 CPU (no GPU support)
-  sudo pip3 install tensorflow     # Python 3.n CPU (no GPU support)
-  sudo pip install tensorflow-gpu  # Python 2.7 GPU support
-  sudo pip3 install tensorflow-gpu # Python 3.n GPU support
+  easy_install -U pip
 
-Success! TensorFlow is now installed. +##### 2. Install TensorFlow on system. + +Choose one of the available TensorFlow packages for installation: + +* `tensorflow` —Current release for CPU +* `tensorflow-gpu` —Current release with GPU support +* `tf-nightly` —Nightly build for CPU +* `tf-nightly-gpu` —Nightly build with GPU support + +And use `pip` to install the package for Python 2 or 3: + +
+  sudo pip install -U tensorflow   # Python 2.7
+  sudo pip3 install -U tensorflow  # Python 3.n
+
Use `pip list` to show the packages installed on the system. [Validate the install](#ValidateYourInstallation) and test the version: @@ -265,6 +312,8 @@ Use `pip list` to show the packages installed on the system. python -c "import tensorflow as tf; print(tf.__version__)" +Success: TensorFlow is now installed. + #### Problems If the above steps failed, try installing the TensorFlow binary using the remote -- 2.7.4