Skip to content

Commit fc72d39

Browse files
committed
Fix Windows-native CPU-only install path and Python version support in pip guide
- Update supported Python versions to 3.10-3.13 (Python 3.9 removed in TF 2.21) - Replace obsolete Miniconda/conda/cudatoolkit Windows-native instructions with venv CPU-only flow - Fix broken #windows-[wsl2] anchor - Refs tensorflow/tensorflow#111734
1 parent 65b54e1 commit fc72d39

1 file changed

Lines changed: 31 additions & 57 deletions

File tree

‎site/en/install/pip.md‎

Lines changed: 31 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ step-by-step instructions.
5050
[TensorFlow-DirectML-Plugin](https://github.com/microsoft/tensorflow-directml-plugin#tensorflow-directml-plugin-)
5151

5252
```bash
53-
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
54-
# Anything above 2.10 is not supported on the GPU on Windows Native
55-
python -m pip install "tensorflow<2.11"
53+
# Native Windows is CPU-only. For GPU support, use Windows WSL2 above.
54+
python -m pip install tensorflow
5655
# Verify the installation:
57-
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
56+
python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
5857
```
5958

6059
* {Windows WSL2}
@@ -133,14 +132,14 @@ enable compute capabilities by [building TensorFlow from source](./source.md).
133132
134133
* Ubuntu 16.04 or higher (64-bit)
135134
* macOS 12.0 (Monterey) or higher (64-bit) *(no GPU support)*
136-
* Windows Native - Windows 7 or higher (64-bit) *(no GPU support after TF 2.10)*
135+
* Windows Native - Windows 10 or higher (64-bit) *(no GPU support after TF 2.10)*
137136
* Windows WSL2 - Windows 10 19044 or higher (64-bit)
138137
139138
Note: GPU support is available for Ubuntu and Windows with CUDA®-enabled cards.
140139
141140
## Software requirements
142141
143-
* Python 3.9–3.12
142+
* Python 3.10–3.13
144143
* pip version 19.0 or higher for Linux (requires `manylinux2014` support) and
145144
Windows. pip version 20.3 or higher for macOS.
146145
* Windows Native Requires
@@ -300,7 +299,7 @@ The following NVIDIA® software are only required for GPU support.
300299
301300
Check if your Python environment is already configured:
302301
303-
Note: Requires Python 3.9–3.11, and pip >= 20.3 for MacOS.
302+
Note: Requires Python 3.10–3.13, and pip >= 20.3 for MacOS.
304303
305304
```bash
306305
python3 --version
@@ -335,13 +334,13 @@ The following NVIDIA® software are only required for GPU support.
335334
Caution: TensorFlow `2.10` was the **last** TensorFlow release that
336335
supported GPU on native-Windows.
337336
Starting with TensorFlow `2.11`, you will need to install
338-
[TensorFlow in WSL2](https://tensorflow.org/install/pip#windows-[wsl2]),
337+
[TensorFlow in WSL2](https://tensorflow.org/install/pip#windows-wsl2),
339338
or install `tensorflow-cpu` and, optionally, try the
340339
[TensorFlow-DirectML-Plugin](https://github.com/microsoft/tensorflow-directml-plugin#tensorflow-directml-plugin-)
341340
342-
## 1. System requirements
341+
### 1. System requirements
343342
344-
* Windows 7 or higher (64-bit)
343+
* Windows 10 or higher (64-bit)
345344
346345
Note: Starting with TensorFlow `2.10`, Windows CPU-builds for x86/x64
347346
processors are built, maintained, tested and released by a third party:
@@ -375,50 +374,29 @@ The following NVIDIA® software are only required for GPU support.
375374
[long paths are enabled](https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing)
376375
on Windows.
377376

378-
### 3. Install Miniconda
379-
380-
[Miniconda](https://docs.conda.io/en/latest/miniconda.html)
381-
is the recommended approach for installing TensorFlow with GPU support.
382-
It creates a separate environment to avoid changing any installed
383-
software in your system. This is also the easiest way to install the
384-
required software especially for the GPU setup.
377+
### 3. Create a virtual environment with [venv](https://docs.python.org/3/library/venv.html){:.external}
385378

386-
Download the
387-
[Miniconda Windows Installer](https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe).
388-
Double-click the downloaded file and follow the instructions on the screen.
379+
The venv module is part of Python's standard library and is the officially
380+
recommended way to create virtual environments.
389381
390-
### 4. Create a conda environment
382+
Note: Starting with TensorFlow 2.21, Python 3.9 is no longer supported.
383+
Install a supported Python version, for example, 3.10-3.13.
391384
392-
Create a new conda environment named `tf` with the following command.
385+
Create a new venv environment named `tf` with the following command.
393386
394387
```bash
395-
conda create --name tf python=3.9
388+
python -m venv tf
396389
```
397390
398-
You can deactivate and activate it with the following commands.
391+
You can activate it with the following command.
399392
400393
```bash
401-
conda deactivate
402-
conda activate tf
394+
tf\Scripts\activate
403395
```
404396
405-
Make sure it is activated for the rest of the installation.
406-
407-
### 5. GPU setup
408-
409-
You can skip this section if you only run TensorFlow on CPU.
410-
411-
First install
412-
[NVIDIA GPU driver](https://www.nvidia.com/Download/index.aspx)
413-
if you have not.
414-
415-
Then install the CUDA, cuDNN with conda.
416-
417-
```bash
418-
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
419-
```
397+
Make sure that the virtual environment is activated for the rest of the installation.
420398
421-
### 6. Install TensorFlow
399+
### 4. Install TensorFlow
422400
423401
TensorFlow requires a recent version of pip, so upgrade your pip
424402
installation to be sure you're running the latest version.
@@ -429,16 +407,21 @@ The following NVIDIA® software are only required for GPU support.
429407

430408
Then, install TensorFlow with pip.
431409

432-
Note: Do not install TensorFlow with conda. It may not have the latest stable
433-
version. pip is recommended since TensorFlow is only officially released to
434-
PyPI.
410+
Note: Native Windows is CPU-only. For NVIDIA GPU support, install
411+
[TensorFlow in WSL2](https://tensorflow.org/install/pip#windows-wsl2).
435412

436413
```bash
437-
# Anything above 2.10 is not supported on the GPU on Windows Native
438-
pip install "tensorflow<2.11"
414+
# For CPU users on native Windows
415+
pip install tensorflow
416+
# Or install the smaller CPU-only package:
417+
# pip install tensorflow-cpu
439418
```
440419

441-
### 7. Verify the installation
420+
Note: Do not install TensorFlow with conda. It may not have the latest stable
421+
version. pip is recommended since TensorFlow is only officially released to
422+
PyPI.
423+
424+
### 5. Verify the installation
442425

443426
Verify the CPU setup:
444427

@@ -448,15 +431,6 @@ The following NVIDIA® software are only required for GPU support.
448431

449432
If a tensor is returned, you've installed TensorFlow successfully.
450433
451-
Verify the GPU setup:
452-
453-
```bash
454-
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
455-
```
456-
457-
If a list of GPU devices is returned, you've installed TensorFlow
458-
successfully.
459-
460434
* {Windows WSL2}
461435
462436
### 1. System requirements

0 commit comments

Comments
 (0)