Skip to content

Commit 9af3e7c

Browse files
Merge pull request #1585 from grasskin:master
PiperOrigin-RevId: 314259635
2 parents f532605 + 38bfc34 commit 9af3e7c

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

site/en/install/pip.html

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,26 @@ <h2>1. Install the Python development environment on your system</h2>
6161
Check if your Python environment is already configured:
6262
</p>
6363

64-
<aside class="note">Requires Python 3.5–3.8 and pip &gt;= 19.0</aside>
64+
<aside class="note">Requires Python 3.5–3.8, pip and venv &gt;= 19.0</aside>
6565

6666
<pre class="prettyprint lang-bsh">
6767
<code class="devsite-terminal">python3 --version</code>
6868
<code class="devsite-terminal">pip3 --version</code>
69-
<code class="devsite-terminal">virtualenv --version</code>
7069
</pre>
7170

7271
<p>
7372
If these packages are already installed, skip to the next step.<br/>
7473
Otherwise, install <a href="https://www.python.org/" class="external">Python</a>, the
7574
<a href="https://pip.pypa.io/en/stable/installing/" class="external">pip package manager</a>,
76-
and <a href="https://virtualenv.pypa.io/en/stable/" class="external">Virtualenv</a>:
75+
and <a href="https://docs.python.org/3/library/venv.html" class="external">venv</a>:
7776
</p>
7877

7978
<div class="ds-selector-tabs">
8079
<section>
8180
<h3>Ubuntu</h3>
8281
<pre class="prettyprint lang-bsh">
8382
<code class="devsite-terminal">sudo apt update</code>
84-
<code class="devsite-terminal">sudo apt install python3-dev python3-pip</code>
85-
<code class="devsite-terminal">sudo pip3 install -U virtualenv # system-wide install</code>
83+
<code class="devsite-terminal">sudo apt install python3-dev python3-pip python3-venv</code>
8684
</pre>
8785
</section>
8886

@@ -94,7 +92,6 @@ <h3>mac OS</h3>
9492
<code class="devsite-terminal">export PATH="/usr/local/bin:/usr/local/sbin:$PATH"</code>
9593
<code class="devsite-terminal">brew update</code>
9694
<code class="devsite-terminal">brew install python # Python 3</code>
97-
<code class="devsite-terminal">sudo pip3 install -U virtualenv # system-wide install</code>
9895
</pre>
9996
</section>
10097

@@ -113,17 +110,15 @@ <h3>Windows</h3>
113110
</ol>
114111
<p>Make sure <a href="https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing" class="external">long paths are enabled</a> on Windows.</p>
115112
<p>Install the <em>64-bit</em> <a href="https://www.python.org/downloads/windows/" class="external">Python 3 release for Windows</a> (select <code>pip</code> as an optional feature).</p>
116-
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">pip3 install -U pip virtualenv</pre>
117113
</section>
118114

119115
<section>
120116
<h3>Raspberry Pi</h3>
121117
<p>Requirements for the <a href="https://www.raspberrypi.org/downloads/raspbian/" class="external">Raspbian</a> operating system:</p>
122118
<pre class="prettyprint lang-bsh">
123119
<code class="devsite-terminal">sudo apt update</code>
124-
<code class="devsite-terminal">sudo apt install python3-dev python3-pip</code>
120+
<code class="devsite-terminal">sudo apt install python3-dev python3-pip python3-venv</code>
125121
<code class="devsite-terminal">sudo apt install libatlas-base-dev # required for numpy</code>
126-
<code class="devsite-terminal">sudo pip3 install -U virtualenv # system-wide install</code>
127122
</pre>
128123
</section>
129124

@@ -132,7 +127,6 @@ <h3>Other</h3>
132127
<pre class="prettyprint lang-bsh">
133128
<code class="devsite-terminal">curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py</code>
134129
<code class="devsite-terminal">python get-pip.py</code>
135-
<code class="devsite-terminal">sudo pip3 install -U virtualenv # system-wide install</code>
136130
</pre>
137131
</section>
138132
</div><!--/ds-selector-tabs-->
@@ -158,13 +152,16 @@ <h3>Ubuntu / mac OS</h3>
158152
Create a new virtual environment by choosing a Python interpreter and making a
159153
<code>./venv</code> directory to hold it:
160154
</p>
161-
<pre class="devsite-terminal devsite-click-to-copy">virtualenv --system-site-packages -p python3 <var>./venv</var></pre>
155+
<pre class="devsite-terminal devsite-click-to-copy">python3 -m venv --system-site-packages <var>./venv</var></pre>
162156
<p>
163157
Activate the virtual environment using a shell-specific command:
164158
</p>
165-
<pre class="devsite-terminal prettyprint lang-bsh">source <var>./venv</var>/bin/activate # sh, bash, ksh, or zsh</pre>
159+
<pre class="devsite-terminal prettyprint lang-bsh">source <var>./venv</var>/bin/activate # sh, bash, or zsh</pre>
160+
<pre class="devsite-terminal prettyprint lang-bsh">. <var>./venv</var>/bin/activate.fish # fish</pre>
161+
<pre class="devsite-terminal prettyprint lang-bsh">source <var>./venv</var>/bin/activate.csh # csh or tcsh</pre>
162+
166163
<p>
167-
When virtualenv is active, your shell prompt is prefixed with <code>(venv)</code>.
164+
When the virtual environment is active, your shell prompt is prefixed with <code>(venv)</code>.
168165
</p>
169166
<p>
170167
Install packages within a virtual environment without affecting the host system
@@ -176,7 +173,7 @@ <h3>Ubuntu / mac OS</h3>
176173
<code class="devsite-terminal tfo-terminal-venv">pip list # show packages installed within the virtual environment</code>
177174
</pre>
178175
<p>
179-
And to exit virtualenv later:
176+
And to exit the virtual environment later:
180177
</p>
181178
<pre class="devsite-terminal tfo-terminal-venv prettyprint lang-bsh">deactivate # don't exit until you're done using TensorFlow</pre>
182179
</section>
@@ -188,7 +185,7 @@ <h3>Windows</h3>
188185
Create a new virtual environment by choosing a Python interpreter and making a
189186
<code>.\venv</code> directory to hold it:
190187
</p>
191-
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">virtualenv --system-site-packages -p python3 <var>./venv</var></pre>
188+
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">python -m venv --system-site-packages <var>.\venv</var></pre>
192189
<p>
193190
Activate the virtual environment:
194191
</p>
@@ -203,7 +200,7 @@ <h3>Windows</h3>
203200
<code class="devsite-terminal tfo-terminal-windows-venv">pip list # show packages installed within the virtual environment</code>
204201
</pre>
205202
<p>
206-
And to exit virtualenv later:
203+
And to exit the virtual environment later:
207204
</p>
208205
<pre class="devsite-terminal tfo-terminal-windows-venv prettyprint lang-bsh">deactivate # don't exit until you're done using TensorFlow</pre>
209206
</section>
@@ -240,7 +237,7 @@ <h2>3. Install the TensorFlow pip package</h2>
240237

241238
<div class="ds-selector-tabs">
242239
<section>
243-
<h3>Virtualenv install</h3>
240+
<h3>Virtual environment install</h3>
244241
<pre class="devsite-terminal tfo-terminal-venv devsite-click-to-copy prettyprint lang-bsh">pip install --upgrade tensorflow</pre>
245242
<p>Verify the install:</p>
246243
<pre class="devsite-terminal tfo-terminal-venv devsite-click-to-copy prettyprint lang-bsh">python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"</pre>

site/en/r1/guide/premade_estimators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Prior to using the sample code in this document, you'll need to do the
99
following:
1010

1111
* [Install TensorFlow](../install).
12-
* If you installed TensorFlow with virtualenv or Anaconda, activate your
12+
* If you installed TensorFlow with venv or Anaconda, activate your
1313
TensorFlow environment.
1414
* Install or upgrade pandas by issuing the following command:
1515

0 commit comments

Comments
 (0)