Cannot install Tensorflow on Windows 11

Can anyone please help with the installation?
I download from tensorflow_cpu-2.11.0-cp310-cp310-win_amd64.whl

The Linux / macOS’s whl file is over 200MB, windows build is odd with only 2KB.

OS is Windows 11 22h2
Mem: 16GB
Python -V 3.11
Python -V 22.3.1

pip3 install tensorflow_cpu-2.11.0-cp310-cp310-win_amd64.whl
ERROR: tensorflow_cpu-2.11.0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.

python -m pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

@Kaito_T,

Welcome to the Tensorflow Forum!

The Linux / macOS’s whl file is over 200MB, windows build is odd with only 2KB.

The windows cpu wheels are only 2KB because they are “installer” wheels. They are only meant to install the actual TF package built by TF’s collaborators. For more details please refer pip#cpu.

You can install tensorflow on your windows as shown below

1. System requirements

  • Windows 7 or higher (64-bit)

Note: Starting with TensorFlow 2.10, Windows CPU-builds for x86/x64 processors are built, maintained, tested and released by a third party: Intel. Installing the windows-native tensorflow or tensorflow-cpu package installs Intel’s tensorflow-intel package. These packages are provided as-is. Tensorflow will use reasonable efforts to maintain the availability and integrity of this pip package. There may be delays if the third party fails to release the pip package. See this blog post for more information about this collaboration.

2. Install Microsoft Visual C++ Redistributable

Install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019. Starting with the TensorFlow 2.1.0 version, the msvcp140_1.dll file is required from this package (which may not be provided from older redistributable packages). The redistributable comes with Visual Studio 2019 but can be installed separately:

  1. Go to the Microsoft Visual C++ downloads.
  2. Scroll down the page to the Visual Studio 2015, 2017 and 2019 section.
  3. Download and install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for your platform.

Make sure long paths are enabled on Windows.

3. Install Miniconda

Miniconda is the recommended approach for installing TensorFlow with GPU support. It creates a separate environment to avoid changing any installed software in your system. This is also the easiest way to install the required software especially for the GPU setup.

Download the Miniconda Windows Installer. Double-click the downloaded file and follow the instructions on the screen.

4. Create a conda environment

Create a new conda environment named tf with the following command.

conda create --name tf python=3.9

You can deactivate and activate it with the following commands.

conda deactivateconda activate tf

Make sure it is activated for the rest of the installation.

5. Install TensorFlow

TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you’re running the latest version.

pip install --upgrade pip

Then, install TensorFlow with pip.

Note: Do not install TensorFlow with conda. It may not have the latest stable version. pip is recommended since TensorFlow is only officially released to PyPI.

# Anything above 2.10 is not supported on the GPU on Windows Native
pip install "tensorflow<2.11" 

6. Verify install

Verify the CPU setup:

python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

If a tensor is returned, you’ve installed TensorFlow successfully.

Please try as suggested above and let us know if you have any blockers?

Thank you!

1 Like

I was able to install it.
Thanks a lot.